REST API - End one or more ongoing actions of a ticket


PUT  /actions/{rfc_number}

  • You can end one or more ongoing actions of the ticket simultaneously.

Notes

      Open url.png  See Service Manager REST API Conventions.

  • You must supply a table in JSON format in the body of the HTTP request.
  • To end a specified action, you must use an end_action object having a JSON object (name/value pair) as its value.
    • Object name: action_id
    • Object value: the identifier for the action to end.
  • To end all current actions simultaneously, you must use the name of the end_action object without a value.
  • To fill in the support person who has actually carried out the action (doneby_id field), you must use one of the fields below:
    • doneby_identification
    • doneby_mail
    • doneby_name

Note: Only a user belonging to the group in charge of the action are authorized. Otherwise an HTTP status code 404 is returned.

  • If successful, an HTTP status code 201 is returned and a URL link (HREF) to the updated resource is provided.

List of parameters / fields

Mandatory parameters

  • You must use the parameter below in the URL.
  • You must use at least one of the optional fields detailed below in the body of the HTTP request. Otherwise an error is returned.
     
Parameter Type Description / Example
rfc_number string Ticket identifier

Optional parameters

None

Optional fields

  • You can use all the fields from the SD_REQUEST table except those mentioned below in the HTTP request string.
    • automatic_action 
    • delete_action 
    • old_value ; new_value 
    • wizard_guid 
    • to_trunc 
    • table_name ; field_name 
    • is_locked_progress_point 
    • net_charge_cur_id 
    • previous_sibling_id 
    • process_step_id
  • You can specify the action_id field to end a specified action. Otherwise all the ongoing actions of the ticket will be ended.
  • You can specify a group name / email to end the actions of a specified group / email. If you specified an action with a non-matching group, a 404 error will be returned.

Description of the actions carried out

The ongoing actions of the ticket are endded.

  • If the action_id is specified, only that action is ended.
  • If the action_id is not specified, all the ongoing actions associated with the rfc_number are ended.

HTTP status codes for the method

StatusHeader
Code Error Description
Status201
201 Created Request processed successfully and an item created.
Status401
401 Unauthorized Authentication process for accessing the resource is incorrect: Login/Password incorrect, Invalid session, Incorrect Service Manager account.

example

{
 "error": "Invalid Login / Password"
}
Status404
404 Not Found Resource not found: Incorrect URI, Missing resource, Incorrect communication with the server, rfc_number not found.

example

{
 "error": "Resource not found"
}
Status405
405 Method not allowed Request method not authorized: not supported or not appropriate for the resource.

example

{
 "error": "Invalid input parameter"
}

Examples

Examples of the body of an HTTP request

  • To end a specified action:
{
 "end_action": {
   "action_id": "12345",
   "doneby_mail": "morley@itassetservices.com",
   "start_date": "12/10/2018",
   "end_date": "12/11/2018",
   "elapsed_time": "1234",
   "available_field_1": "Closed via REST API call"
  }
}
  • To end all current actions simultaneously:
{
 "end_action": {
   "doneby_mail": "morley@itassetservices.com",
   "start_date": "12/10/2018",
   "end_date": "12/11/2018",
   "elapsed_time": "1234",
   "available_field_1": "Closed via REST API call"
  }
}
  • To accept a validation action:
{
 "end_action": {
   "action_id": "12345",
   "doneby_mail": "morley@itassetservices.com",
   "start_date": "12/10/2018",
   "end_date": "12/11/2018",
   "elapsed_time": "1234",
   "available_field_1": "Closed via REST API call",
   "choice":"1"
  }
}
  • To refuse a validation action:
{
 "end_action": {
   "action_id": "12345",
   "doneby_mail": "morley@itassetservices.com",
   "start_date": "12/10/2018",
   "end_date": "12/11/2018",
   "elapsed_time": "1234",
   "available_field_1": "Closed via REST API call",
   "choice":"0"
  }
}

Result with a status code 201 returned

{
 "HREF": "https://{your_server}/api/v1/{your_account}/actions/I161019_000003"
}


ConventionsAPI

REST API Conventions

Convention Meaning
Orange Parameters used in an HTTP request string which do not correspond to Service Manager database fields.

example   Method View a list of assets


https://{your_server}/api/v1/{your_account}/assets?max_rows=3&fields=asset_tag

Black and Bold Parameters used in the URL of an HTTP request which correspond to Service Manager database fields.

example   Method View an asset


https://{your_server}/api/v1/{your_account}/assets/{asset_id}

Green Parameters used in the body of an HTTP request which represent JSON object names corresponding to Service Manager database fields; they allow the value of a database field to be assigned or modified.

example   Method Close an incident/request

{  "closed": {  "end_date": "11/20/2019 12:12:12",  }  }
Parameters used in the body of an HTTP request which represent JSON object names not corresponding to Service Manager database fields.

example   Method Reopen an incident/request

{  "restarted": {  "comment": "string (required)"  }  }

Tags:
Last modified by Unknown User on 2020/03/30 11:52
Created by Administrator XWiki on 2017/04/07 12:04

Shortcuts

Recent changes
•  EV Service Manager
•  Service Apps
•  EV Self Help
•  Service Bots

Powered by XWiki ©, EasyVista 2021