Close a Task
Closes a task by setting task status to "Close"
Table of Contents
Details
Closes a task by setting task status to "Close".
Request
URL
POST https://{server_name}/m42Services/api/task/close
Headers
For a list of available HTTP request headers see Web Services: REST API integration.
POST body
| Element | Description | Type | Required |
|---|---|---|---|
| ObjectIds | Array of GUIDs of the tasks to be closed. | Array of GUIDs | Required |
| Comments | HTML formatted text for the task solution | string | Required |
| Reason |
specifies a reason for the closed task. Possible reason values and meaning:
|
integer | Optional |
| CategoryId |
All available category GUIDs can be retrieved by get a list of fragments method from SPSScCategoryClassBase fragment, ID element. |
GUID | Optional |
| KBArticle |
GUID identifier of the existing knowledge base article that should be related to the closed task. All available knowledge base article GUIDs can be retrieved by get a list of fragments method from SVMKBArticleClassBase fragment, ArticleID element. |
GUID | Optional |
| Task-related user e-mail notification settings | |||
| SendMailToUsers |
|
boolean | Optional |
| SendMailToInitiator |
|
boolean | Optional |
| NotifyResponsible |
|
boolean | Optional |
| InformFurtherUsers |
users that should be additionally notified of the closed task via email. Specify GUIDs of the users who are to receive a one-time email notification about the closed task(s). All available user GUIDs can be retrieved by get a list of fragments method from SPSUserClassBasefragment. |
array of GUIDs | Optional |
| SendMailToRelatedResponsibleUsers |
|
boolean | Optional |
Sample Request
POST https://{server_name}/m42Services/api/task/close
Authorization: Bearer YWsamplezhZARaccessGDuctoken2sYW1
Content-Type: application/json;charset=UTF-8
{
"ObjectIds":[
"0dd1548e-bbec-c1b5-7d27-08d6a253fcc4"
],
"Comments":"<p>Task solution text<p>",
"Reason":408,
"CategoryId":"D0F04F85-458F-40BD-AEB0-E97B08B933B5",
"KBArticle":"0dd1548e-bbec-c1b5-7d27-08d6a253fcc4",
"SendMailToUsers":true,
"SendMailToInitiator":true,
"NotifyResponsible":true,
"InformFurtherUsers":[
"938a1d78-bde2-4270-9892-402889a263f3"
],
"SendMailToRelatedResponsibleUsers":true
}
Response
The server does not return any response.
Status codes and errors
| Code | Message |
|---|---|
| 204 No content | indicates that the server has successfully fulfilled the request and that there isno content to send in the response payload body. |
| 400 Bad Request | specifies missing required parameters and arguments of the body message. |
| 500 Internal server error |
|