REST API - Create a ticket


POST  /requests

  • It supports the creation of only one ticket per call.

Notes

    Open url.png  see Product name - ev itsm.png REST API Conventions 

  • You must supply a table in JSON format in the body of the HTTP request.
  • If successful, an HTTP status code 201 is returned and a URL link (HREF) to the created resource is provided.
CommonNotes_JSONandFields
  • JSON Format and Field Format:
    • The field names are those of the Product name - ev itsm.png.data model.
              Example documentation icon EN.png  available_field_1
    • To update a field, respect the following JSON format: "field_name":"value".
               Example documentation icon EN.png  "e_mail": "test@easyvista.com"
    • JSON object names, including those representing Product name - ev itsm.png database fields, are not case sensitive.
               Example documentation icon EN.png  field_name, Field_Name and FIELD_NAME are equivalent 

List of parameters / objects

Mandatory parameters

You must use at least one of the JSON objects below in the body of the HTTP request.

Notes:

  • The subject can be specified with catalog_guid (use in preference) or catalog_code.
  • If catalog_guid is wrong, the process stops without reading catalog_code.
     
Object Type Description / Example
catalog_guid string Identifier for the subject of the ticket
catalog_code string Code for the subject of the ticket

Optional parameters

None

Optional fields

  • You can use all the JSON fields from the SD_REQUEST table in the body of the HTTP request.
     
Parameter Type Description / Example
assetid, assettag, asset_name string Identifier / Tag / Asset name
  • The objects are processed in this priority order by the search algorithm.
ci_id, ci_asset_tag, ci_name string CI Identifier / Asset tag of the CI / CI name
  • The objects are processed in this priority order by the search algorithm.
department_id, department_code string Identifier / Department code of the requestor
  • The objects are processed in this priority order by the search algorithm.
description string Description of the object
external_reference string Identifier of the object attributed by an external application.
location_id, location_code string Identifier / Location code of the requestor
  • The objects are processed in this priority order by the search algorithm.
origin string Identifier of the origine (Examples: Phone, Email)
parentrequest string Identifier of the related request (parent request) attachede to the object
phone string Phone number of the requestor
recipient_id, recipient_identification, recipient_mail, recipient_name string Identifier / Employee number / Email address / Name of the recipient
  • The objects are processed in this priority order by the search algorithm.
requestor_identification, requestor_mail, requestor_name string Employee number / Email address / Name of the requestor
  • The objects are processed in this priority order by the search algorithm.
severity_id integer Identifier of the severity level
submit_date string Creation date of the object
  • By default, current date (now).
urgency_id integer Identifier of the urgency level
  • In addition to the fields provided by Logo - EasyVista.png, you can also assign values to the fields which you have added to the Product name - ev itsm.png database. These are fields with the prefix e_.
             Example documentation icon EN.png e_field_name_xyz

Description of the actions carried out

1. The API creates a ticket (record in the SD_REQUEST table).

  • submit_date = now
  • If recipient_id is passed as a parameter:
    • location_id = location_id of the recipient_id
    • department_id = department_id of the recipient_id
    • requestor_phone = phone of the recipient_id
    • rfc_number ==> Get NewIncidentNumber
    • max_resolution_date_ut ==> calculateMaxResolution(SLA_id to be retrieved)
    • first_call_resolution ==> 0
    • status_id = Key status_id the GUID of which is {6e554fc1-1a5d-47e4-b303-cd98a8767aec} [12 - in general In progress]
  • If parentRequest is specified:
    • parentRequest_id specified (linked request)

2. Then it creates a CALL action in the AM_ACTION table associated with the ticket.

  • request_id = request_id of the ticket which has just been created
  • doneBy_id = requestor_id of the ticket which has just been created
  • creation_date_ut = start_date_ut = end_date_ut = SD_REQUEST.submit_date
  • action_type_id = 7
  • AM_ACTION.contact_id = SD_REQUEST.requestor_id

3. Then it starts the workflow associated with the ticket.

  • The workflow_id is recovered following the same mechanism as the SLA_id (managed overloads and tree structures).

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 Product name - ev itsm.png account.
Example documentation icon EN.png
{
 "error": "Invalid Login / Password"
}
Status500
500 Internal Server Error Generic error message displayed when an unexpected condition is encountered and there is no appropriate message which is more specific.
Example documentation icon EN.png
{
 "error": "An error occured. A text message is returned in the body."
}

Examples

Example of the body of an HTTP request

{
   "requests" :
    [{
     "Catalog_Code" : "46",
     "AssetID" : "",
     "AssetTag" : "",
     "ASSET_NAME" : "",
     "Urgency_ID" : "1",
     "Severity_ID" : "40",
     "External_reference" : "",
     "Phone" : "93-63 - 65-23",
     "Requestor_Identification" : "",
     "Requestor_Mail" : "morley@itassetservices.com",
     "Requestor_Name" : "",
     "Location_ID" : "",
     "Location_Code" : "",
     "Department_ID" : "",
     "Department_Code" : "",
     "Recipient_ID" : "",
     "Recipient_Identification" : "",
     "Recipient_Mail" : "leblanc@itassetservices.com",
     "Recipient_Name" : "",
     "Origin" : "3",
     "Description" : "Request created via REST API",
     "ParentRequest" : "",
     "CI_ID" : "",
     "CI_ASSET_TAG" : "",
     "CI_NAME" : "",
     "SUBMIT_DATE" : ""
    }]
}

Result with a status code 201 returned

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


ConventionsAPI

REST API Conventions

Convention Meaning
Orange Parameters used in an HTTP request string (URL) which do not correspond to Product name - ev itsm.png database fields.
Example documentation icon EN.png   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 Product name - ev itsm.png database fields.
Example documentation icon EN.png   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 Product name - ev itsm.png database fields; they allow the value of a database field to be assigned or modified.
Example documentation icon EN.png   Method Close an incident/request

{  "closed": {  "end_date": "11/20/2016 12:12:12",  }  }
Parameters used in the body of an HTTP request which represent JSON object names not corresponding to Product name - ev itsm.png database fields.
Example documentation icon EN.png   Method Reopen an incident/request

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

Tags:
Last modified by Unknown User on 2018/11/14 12:30
Created by Administrator XWiki on 2017/04/07 12:02

Shortcuts

Recent Updates

Haven't been here in a while? Here's what changed recently:

-   Product name - ev itsm.png
-   Product name - ev sas.png

Interesting Content

How to Automate Integration
Add a Shortcut to an App
History
Quick Dashboard
Full text search - Stop Words

Powered by XWiki ©, EasyVista 2018