REST API - Update a ticket


PUT  /requests/{rfc_number}

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.
  • If the list of parameters is a combination of both existing and non-existing fields, the request returns an HTTP status code 201 as long as at least one field is found and its value modified. If no field is found, the request is considered incorrect and an HTTP status code 400 is returned.
  • If successful, an HTTP status code 201 is returned and a URL link (HREF) to the updated 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

Optional parameters

None

Optional fields

  • You can use all the fields from the SD_REQUEST table except those mentioned below in the body of the HTTP request.

    rfc_number ; request_id ; location_id ; request_project_id ; recipient_id ; severity_id ; status_id ; department_id ; parent_request_id ; last_group_id ; last_done_by_id ; submitted_by ; kbase_id ; sla_id ; sd_catalog_id ; initial_sd_catalog_id ; order_id ; news_id ; project_idvert case

  • You can modify the value of the fields referenced in other tables, related to a specific alias.
     
Parameter Type Description / Example
analytical_charge_id string or integer
  • Table: EP_ANALYTICAL_CHARGE
  • Value to be used: ANALYTICAL_CHARGE_CODE or ANALYTICAL_CHARGE_ID
example {"ANALYTICAL_CHARGE_ID": "0302"} or {"ANALYTICAL_CHARGE_ID": "1"}
asset_id integer
  • Table: AM_ASSET
  • Value to be used: Primary Key
example {“asset_id": "27618"}
asset_serial string
  • Table: AM_ASSET
  • Value to be used: SERIAL_NUMBER
example {"ASSET_SERIAL": "MGTRDF"}
asset_tag or asset string
  • Table: AM_ASSET
  • Value to be used: ASSET_TAG
example {"ASSET_TAG": "10164R"} or {"ASSET": "10164R"}
available_field_x string
  • Table: SD_REQUEST
  • Value to be used: text
example {"AVAILABLE_FIELD_1": "available_field_1_test"}
ci string
  • Table: AM_ASSET
  • Value to be used: NETWORK_IDENTIFIER
example {"CI": "SQL-RDB_IT*"}
ci_id integer
  • Table: AM_ASSET
  • Value to be used: ASSET_TAG
example {"CI_ID": "1"}
ci_serial string
  • Table: AM_ASSET
  • Value to be used: SERIAL_NUMBER
example {"CI_SERIAL": "KD78QGJYU"}
comment string
  • Table: SD_REQUEST
  • Value to be used: text
example {"Comment": "Here, your comment"}
continuity_plan_id string or integer
  • Table: CMDB_CONTINUITY_PLAN
  • Value to be used: CODE or CONTINUITY_PLAN_ID
example {"CONTINUITY_PLAN_ID": "CP01"} or {"CONTINUITY_PLAN_ID": "1"}
description string
  • Table: SD_REQUEST
  • Value to be used: text
example {"Description": "Here, your description"}
external_reference string
  • Table: SD_REQUEST
  • Value to be used: text
example {"External_reference": "external_ref_test"}
impact_id integer
  • Table: SD_IMPACT
  • Value to be used: IMPACT_ID
example {"IMPACT_ID": "1"}
known_problems_id integer
  • Table: SD_KNOWN_PROBLEMS
  • Value to be used: Primary Key
example {"KNOWN_PROBLEMS_ID": "1"}
net_price_cur_id string ou integer
  • Table: AM_CURRENCY
  • Value to be used: CURRENCY or CURRENCY_ID
example {"NET_PRICE_CUR_ID": "EUR"} or {"NET_PRICE_CUR_ID": "3"}
origin_tool_id integer
  • Table : SD_REQUEST
  • Valeur à utiliser : ORIGIN_TOOL_ID
example {"ORIGIN_TOOL_ID": "1"} ou {"ORIGIN_TOOL_ID": "2"}
owner_id string or integer
  • Table: AM_EMPLOYEE
  • Value to be used: LAST_NAME or EMPLOYEE_ID
example {"OWNER_ID": "Leblanc, Fred"} or {"OWNER_ID": "10469"}
owning_group_id string or integer
  • Table: AM_GROUP
  • Value to be used: GROUP_LNG or GROUP_ID
example {"OWNING_GROUP_ID": "Desktop USA"} or {"OWNING_GROUP_ID": "139"}
release_id string or integer
  • Table: CMDB_RELEASE
  • Value to be used: RELEASE_CODE or RELEASE_ID
example {"RELEASE_ID": "REL01"} or {"RELEASE_ID": "1"}
rental_net_price_cur_id string
  • Table: AM_CURRENCY
  • Value to be used: CURRENCY or CURRENCY_ID
example {"RENTAL_NET_PRICE_CUR_ID": "EUR"} or {"RENTAL_NET_PRICE_CUR_ID": "3"}
request_origin_id string or integer
  • Table: SD_REQUEST_ORIGIN
  • Value to be used: NAME_LNG or REQUEST_ORIGIN_ID
example {"REQUEST_ORIGIN_ID" : "Fax"} or {"REQUEST_ORIGIN_ID": "2"}
requestor_phone string
  • Table: SD_REQUEST
  • Value to be used: text
example {"REQUESTOR_PHONE" : "93-63-65-23"}
root_cause_id string or integer
  • Table: AM_REFERENCE
  • Value to be used: REFERENCE_LNG or REFERENCE_ID
example {"ROOT_CAUSE_ID": "Virus"} or {"ROOT_CAUSE_ID": "70"}
submit_date_ut string
  • Table: SD_REQUEST
  • Value to be used: text
example {"SUBMIT_DATE_UT" : "07/22/2017"}
system_id string or integer
  • Table: AM_REFERENCE
  • Value to be used: REFERENCE_LNG or REFERENCE_ID
example {"SYSTEM_ID": "Supervisor"} or {"SYSTEM_ID": "1"}
urgency_id integer
  • Table : SD_URGENCY
  • Valeur à utiliser : URGENCY_ID
example {"URGENCY_ID": "1"}
  • In addition to the fields provided by EasyVista, you can also assign values to fields which you have added to the Service Manager database. These are fields with the prefix e_.
             example  e_field_name_xyz

HTTP status codes for the method

StatusHeader
Code Error Description
Status201
201 Created Request processed successfully and an item created.
Status400
400 Bad Request Request formulated incorrectly and cannot be executed correctly.

example

{
 "error": "Nothing to update (check fieldnames)"
}
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

Example of the body of an HTTP request

{
 "Comment": "REST API Update - This comment has been updated from the REST API",
 "available_field_1": "Patching computers",
 "external_reference": "TEST"
}

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 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/09/03 11:27
Created by Administrator XWiki on 2017/04/07 12:02

Shortcuts

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

Powered by XWiki ©, EasyVista 2021