Content and Experience

Get Involved. Join the Conversation.

Topic

    ROSHAN BAIG
    How to upload a image into Content and Experience Cloud...
    Topic posted August 1, 2019 by ROSHAN BAIG, tagged APIs, Content Management, Documents 
    42 Views, 1 Comment
    Title:
    How to upload a image into Content and Experience Cloud using it's REST API
    Summary:
    I am trying to upload an image into Content and Experience Cloud using it's REST API
    Content:

    Below is the payload which i am using to upload a text file, which works fine. Now my question is how do i upload an image file with the same payload.

    Should the content of the image be encoded or what does the API accept? Any suggestions please?

     

    Code Snippet:

    Comment

     

    • Paul Roddin

      The body would look something like this:
      ...
      ...
      ------WebKitFormBoundary7MA4YWxkTrZu0gW--,
      Content-Disposition: form-data; name="parameters"

      {"parentID":"F7D2E128D47B268D46726140E0DE0255F6C149D47067"}
      ------WebKitFormBoundary7MA4YWxkTrZu0gW--
      Content-Disposition: form-data; name="primaryFile"; filename="/C:/Users/Example/Downloads/Sonic.png


      ------WebKitFormBoundary7MA4YWxkTrZu0gW--

      In Postman, you can set this up like this: