REST API - Create an action for a ticket


POST  /requests/{rfc_number}/actions

  • The method supports the creation of a single action per call.

Notes

      Open url.png  See Service Manager REST API

  • You must supply a table in JSON format in the body of the HTTP request.
  • To define the type of action for the action to be created, you can use the name of the action_type_id (preferably) or the action_type_name objects. In the latter case, you must enter the value of the object in the language of the user logged in to the REST API.
  • To define the group assigned to the task, you can use the name of the group_id, the group_name or the group_mail objects.
  • If successful, an HTTP status code 201 is returned and a URL link (HREF) to the created resource is provided.
CommonNotes_JSONandFields

JSON Format / Field Format:

  • The field names are those of the Service Manager.data model.

    example  available_field_1

  • To update a field, respect the following JSON format: "field_name":"value".

  • JSON object names, including those representing Service Manager database fields, are not case sensitive.

    example  field_name, Field_Name and FIELD_NAME are equivalent

List of parameters / fields

Mandatory parameters

  • You must use the parameter below in the URL.
     
Parameter Type Description / Example
rfc_number string Ticket identifier
  • You must use the JSON objects below in the body of the HTTP request.
Parameter Type Description / Example
action_type_id, action_type_name integer / string Identifier / Name for the action type to be created
group_id / group_mail / group_name integer / string Identifier / E-mail address / Name of the group who must perform the action

Optional parameters

None

Optional fields

You can use all the fields from the AM_ACTION table in the body of the HTTP request.
 

Minimum version Parameter Type Description / Example
creation_date_ut string Creation date of the action, expressed in Universal Time.
  • By default, current date (now).
Autumn 2020 - Build 2020.2.122.2 comment string Description related to the object
contact_id, contact_identification, contact_mail, contact_name integer / string Key / Employee number / Email address / Contact name in charge of the action.
  • The objects are processed in this priority order by the search algorithm.
description string Comment related to the object
doneby_id, doneby_identification, doneby_mail, doneby_name integer / string Key / Employee number / Email address / Support name in charge of the action.
  • The objects are processed in this priority order by the search algorithm.
expected_start_date_ut / expected_end_date_ut string Scheduled start date / Scheduled end date of the action, expressed in Universal Time.
group_id, group_mail, group_name integer / string Key / Email address / Group name in charge of the action.
  • The objects are processed in this priority order by the search algorithm.
max_intervention_date_ut string Latest possible date where the action needs to be executed, expressed in Universal Time.
  • If the date is not completed, it is computed starting from the creation date of the action and the OLA of the group.
parent_action_id integer Key of the parent action.

Description of the actions carried out

An action associated with the ticket is created.

  • status In progress
  • The calculations of the creation wizard are done.

You can specify the parent_action_id field in the json body:

  • If the parent_action_id is completed: the created action will be attached to the parent_action_id
  • If the parent_action_id is not completed:
    • The created action will be attached to the last action related to the rfc_number which are assigned to the user / group passed as parameters.
    • If several parent actions are found, cancellation of the process (there is an ambiguity on parent_action_id).

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"
}
Status405
405 Method not allowed Request method not authorized: not supported or not appropriate for the resource.

example

{
 "error": "Invalid input parameter"
}

Examples

Example of the body of an HTTP request

{
"action": {
   "action_type_id": "10",
   "group_name": "US network expert"
    }
}

Result with a status code 201 returned

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


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 2021/08/31 17:13
Created by Administrator XWiki on 2019/12/16 17:23

Shortcuts

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

Powered by XWiki ©, EasyVista 2021