POST

Generate Attachment Upload Url


Generates an upload URL for uploading a file as an attachment to a specified contact.

To learn how to use the generated upload URL in the response to upload an attachment file, see the Upload API (SDK | REST).

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Contact Attachments
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/contacts/v4/attachments/{contactId}/upload-url

Path Params
contactIdstringRequired

ID of the contact for whom the attachment is being uploaded.

Body Params
fileNamestringRequiredminLength 1maxLength 260

File name of the attachment including the extension, for example, contact-cv.pdf.


mimeTypestringRequiredminLength 1maxLength 255

Mime type of the attachment file, for example, application/pdf. See supported mime types (REST| SDK).

Response Object
uploadUrlstringformat WEB_URL

The URL for uploading a file as an attachment to the contact.

Generate Attachment Upload Url Example 1
Request
cURL
curl -X POST \ 'https://www.wixapis.com/contacts/v4/attachments/513c1bfc-61b6-427d-a7f8-ceeedb1eb763/upload-url' \ -H 'Authorization: <AUTH>' \ --data-binary '{ "contactId": "513c1bfc-61b6-427d-a7f8-ceeedb1eb763", "fileName": "my-data.csv", "mimeType": "text/csv" }'
Response
JSON
{ "uploadUrl": "https://wixmp-8be454c954980f083caba37c.appspot.com/_ah/upload/AMmfu6Z00Ya5E7SPa7dsD0-iPgB_7_mbS5-I2wxanQjYsM6N99Yd6Tb9ty86XlpULTnXVoYj_ryWmrC4NA3YBrA6W7Ln_86kPeDvoYRXLJ5geqsnTlbTdezpsO1NMvm4rm2B4nrMeunH2vgmBiiqyxk5g1fxJuuH6Tzpx0eq-tDRkeV2tLXwffLDdo-gON4eHrYjSOq7ql9XCX1-Ml88mQFUg4h_jw-qaBpVbsGLrjHbeaijM38VtiqvExHUSjVkuPc4GrlnB35nFHwlCx_8hn2qnXQTHcdZlOpRASbL4Dt4KmaVDx0d0bg/ALBNUaYAAAAAX8jL_p1GRljz1mIXmSwnVPse-iWgiw7u/" }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?