URL
POST https://{api-url}/api/v2/tenants/{tenantId}/tasks/{taskId}/responses
Sample URLs
https://{api-url}/api/v2/tenants/client_1000/tasks/TASK0000001109/responses
Parameters
Field | Data Type | Description |
---|---|---|
description | String | Short summary describing the response. |
tags | String | (Optional) Labels attached to the response. |
attachments | Object | (Optional) Attachments for the particular response. |
timeSpent | Integer | (Optional) Time spent on the task (represented in minutes). |
internal | Boolean | (Optional) Setting internal=true restricts visibility of response to users within the organization. Setting internal=false represents visibility of response to all the users. |
creator | String | (Optional) If internal=true, creator is mandatory. Provide:
|
Note
- For attachments, files must be converted to bytes stream with base64-encoding.
- The default creator (OpsRamp API User) uses id and loginName to change default settings.
- Make default submission status of a pending request as open, the status of the incident which is in Pending status will change to Open status.
- The maximum file attachment size is 50MB.
Status code
200 OK
Sample request
{
"description": "Task Attachment",
"tags": "API, Task",
"timeSpent": "120",
"internal": "false",
"creator": {
"id": "USR0000002146",
"loginName": "FSSL-API-Lab-User-1"
},
"attachments": [{
"name": "file-1.txt",
"file": "U2FtcGxlIFRleHQgZmlsZS0gdGVzdGluZyB3aXRoIGF0dGFjaG1lbnQ="
},
{
"name": "file-2.txt",
"file": "U2FtcGxlIFRleHQgZmlsZS0gdGVzdGluZyB3aXRoIGF0dGFjaG1lbnQ="
}
]
}
Sample response
{
"creator": {
"id": "USR0000002146",
"loginName": "FSSL-API-Lab-User-1",
"lastName": "API-Lab",
"firstName": "FSSL",
"email": "fssl.user@gmail.com"
},
"createdDate": "2016-03-29T08:53:48+0000",
"attachments": [{
"id": 90,
"name": "file-1.txt",
"createdDate": "2016-03-29T08:53:48+0000",
"contentURL": "https://{api-url}/api/v2/tenants/client_7/tasks/TASK0000001109/responses/1896/resources/90"
},
{
"id": 91,
"name": "file-2.txt",
"createdDate": "2016-03-29T08:53:48+0000",
"contentURL": "https://{api-url}/api/v2/tenants/client_7/tasks/TASK0000001109/responses/1896/resources/91"
}
],
"hasAttachments": true,
"tags": "API,Task",
"timeSpent": 120,
"internal": "false",
"description": "Task Attachment"
}