The Zenvia Customer Cloud API offers functionalities that allow querying attachment information directly through HTTP requests. With this API, you can integrate and download attachments into your system, automating queries and retrieving specific files.
API Management
To use the API, it is necessary to obtain an Authentication Token, which must be included in all requests via the header. This token can be generated in the Support Management - Enterprise dashboard by following these steps:
- Access the Settings menu.
- Go to Account > Parameters.
- In the Environment tab, scroll to the bottom of the page to find the Token. Copy the provided key.
This token should be treated as a security key, avoiding unauthorized sharing.
In addition to the Authentication Token, a file's Hash will be required. This can be obtained using other system APIs, such as the tickets API.
With the authentication key and the Hash in hand, select a tool to test the API. We recommend using Postman, a widely used software for easily testing and manipulating APIs.
Step-by-step testing with Postman
- Open Postman and create a new request.
- In the URL field, enter the API endpoint you want to query. For example, to list an attachment, use the following endpoint:
https://api.movidesk.com/public/v1/storage/download?token=TOKEN&id=HASH - Paste the Token key into the corresponding field.
- Paste the Hash into the ID field, obtained from a prior API query.
- Select the appropriate HTTP method, in this case, GET.
- Click Send to send the request to the API.
Limits and Security
The API has a limit of 10 requests per minute to ensure stable performance. If your scenario requires a higher volume of requests, contact technical support to analyze feasibility. For more information, refer to the official documentation on API timings and limits.
API Integration: Downloading an Attachment
Downloading a specific attachment can be done using its ID (Hash). The endpoint for this operation is:
- URL: /public/v1/storage/download?token=TOKEN&id=HASH
- Method: GET
Property | Type | Description |
token | string | System token |
id | string | Attachment Hash ID |
Request example in Postman:
GET
https://api.movidesk.com/public/v1/storage/download?token=88888888-8888-8888-8888-888888888888&id=44444444444444444444444444444444
This request will return the attachment corresponding to the provided ID. If the attachment format is supported by Postman, the content will be displayed in a preview.
Response Examples
- If the ID is not found or the Token is invalid:
- Response: HTTP Status 404.
- If the ID is successfully found:
- Response: HTTP Status 200.
- The file will be sent in the corresponding format with the appropriate Content-Type for download.