Create ticket attachment token
Issues a token used to upload a ticket attachment. Send the file data to the Upload file endpoint (POST /api/sonar/upload) with the issued token, and then attach the uploaded file to a ticket with the Create ticket attachment endpoint using the returned file GUID. To abort the upload, remove the token with the Cancel ticket attachment token endpoint.
Required Permissions
Available to any authenticated user.
HTTP Request
POST /api/sonar/ticket-attachment-tokens
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-X POST \
-d '{"file_name": "report.pdf"}' \
https://HOSTNAME/api/sonar/ticket-attachment-tokens
Request Parameters
| Key | Required | Type | Description | Notes |
|---|---|---|---|---|
| file_name | Yes | String | Name of the file to upload |
Success Response
{
"token": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
- token (String): The issued file upload token. Pass it as the
tokenparameter of the Upload file endpoint. 36-character GUID format.
Error Responses
File name is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "file_name should be not null"
}