POST Upload V1 Attachment
URL: http://{{server-url}}/api/v1/files/upload
You can call the above endpoint to upload a file in the ServiceOps system. When you upload a file, you get a reference filename, which you can pass in the body while creating or updating a request ticket; this associates the file with the ticket.
You need the following key-values:
Header
| Key | Description |
|---|---|
| Authorization | Bearer {access token obtained after authorization} |
Body
| Key | Description |
|---|---|
| file | Attachment |
Example (Request & Response)
Request
curl --location 'http://172.16.11.160/api/v1/files/upload' \ --header 'Authorization: Apikey cuhEo6Av4WD6sShZ%40oyNkwV7KPlzyNjGMfyzwJO88JSMA3tkyrSmpl60iJIayOHvAHA9n' \ --form 'file=@"/C:/Users/Downloads/Troubleshooting Guide for Email-to-Ticket Feature.docx"'
Response
{
"refFileName": "4d1783e6-f25f-4dec-8a4d-0984d4dbaa6c",
"realName": "Troubleshooting Guide for Email-to-Ticket Feature.docx"
}
Next, once the response is received, use it while attaching an attachment to the ticket at the time of creation or updation.