Post attachment over api with attachment download url


I am trying to copy an attachment from one page to another. I know that I can get the download uri over a rest api call (

In the create attachment rest api call (, it is stated that I only need the path to the attachment and the attachment name. But I have no idea how the ‘file’ object should look like with only those two parameters.
Can someone help? / Give me an example?

Many Thanks

1 Like

Is the question how to attach the actual file data (from the client) in the request to create a new attachment?

For java, is a great tutorial

In postman, In the “body” tab, you should select a “form-data” and be able to add a “Key” named “file” and choose its type as “File” instead of “Text” and select the file to upload.

Hi MilindPatil

(I am trying to copy an attachment from one page to another)

I still don’t know how this file object should look like. In the links above to your rest api documentation you mention that I only need the link of the attachment location to the binary data and the attachment name:

And give this json as example:

I get the location from your download attachment rest api.

But I still don’t know how this file property should look like. Do I need to get the content from the download url (binary data) and create on our side a new file → and write the binary representation of it there (not preferred and seems complicated)? Isn’t it possible to just add the file name and location of the binary data as described in your rest api? How do I do that? How would the file property look like? With for example ‘download_link’ as relative location and ‘attachment example’ as name. (I am using Node.js)

When I add the download link in the file property, I get this error:
Screenshot from 2022-06-29 17-13-42