How to create a Change Order via REST API using JSON instead of XML?
search cancel

How to create a Change Order via REST API using JSON instead of XML?

book

Article ID: 139458

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager

Issue/Introduction

This article provides a sample code in JSON on how to create a Change Order in SDM via REST API

Environment

Release : 17.3.X

Component : SERVICE DESK MANAGER

Resolution

The sample code is provided below:

POST /caisd-rest/chg HTTP/1.1
Host: SDMHostName:8050
X-AccessKey: 1115504361
Accept: application/json
X-Obj-Attrs: chg_ref_num
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: 115220d5-aa39-954d-417a-7d7adc78db09

{
 "chg": {
 "requestor":{"@id":"U'BA17859C2BF8104CBCE325534FD24B6F'","@REL_ATTR":"U'BA17859C2BF8104CBCE325534FD24B6F'","@COMMON_NAME":"ServiceDesk"},
 "affected_contact":{"@id":"U'BA17859C2BF8104CBCE325534FD24B6F'","@REL_ATTR":"U'BA17859C2BF8104CBCE325534FD24B6F'","@COMMON_NAME":"ServiceDesk"},
 "requested_by":{"@id":"U'BA17859C2BF8104CBCE325534FD24B6F'","@REL_ATTR":"U'BA17859C2BF8104CBCE325534FD24B6F'","@COMMON_NAME":"ServiceDesk"},
 "status":{"@id":"6000","@REL_ATTR":"OP","@COMMON_NAME":"Open"},
 "summary":"test",
 "description":"test",
 }
}

 

Result is below:

{
    "chg": {
        "@id": "400054",
        "@REL_ATTR": "400054",
        "@COMMON_NAME": "24",
        "link": {
            "@href": "http://SDMHostName:8050/caisd-rest/chg/400054",
            "@rel": "self"
        },
        "chg_ref_num": 24
    }
}

Additional Information

Obtain the X-AccessKey via login method 

https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/business-management/ca-service-management/17-2/reference/ca-service-desk-manager-reference-commands/technical-reference/rest-http-methods.html#concept.dita_571265def7bea5a79bc6e3bba4cd061d4d03b036_RESTandObjectAccess


This can also be attempted with just common_name too, example:

{
 "chg": {
 "requestor":{"@COMMON_NAME":"ServiceDesk"},
 "affected_contact":{"@COMMON_NAME":"ServiceDesk"},
 "requested_by":{"@COMMON_NAME":"ServiceDesk"},
 "status":{"@COMMON_NAME":"Open"},
 "summary":"test",
 "description":"test",
 }
}