Announcement

Collapse
No announcement yet.

Adding multiple jpg files via API

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding multiple jpg files via API


    Can someone guide me through adding multiple jpg files via API? (The files are not uploaded to the server)


  • #2
    This is an example of adding an attachment to a case:

    1. Create the attachment entity

    POST
    localhost\espocrm\api\v1\attachment

    BODY

    {
    "name": "1114.png",
    "type": "text/plain",
    "role": "Attachment",
    "parentType": "Case",
    "field": "attachments",
    "file": "data:text/plain;base64,<insert you base64 attachment content here>"
    }



    2. Link attachment to Case
    POST
    /case/<insert case id here>/attachments

    BODY
    {"id": "<insert attachment id returned from previous POST here>"}

    in case of multiple files you can change the body to :

    {"ids": ["<id1>","<id2>","<id3>"........]}
    Last edited by Ceonello; 09-15-2021, 03:33 PM.

    Comment

    Working...
    X