Skip to main content
Matrix42 Self-Service Help Center

Object Data Service: Create Object

Details

Creates a new Object of the specified Configuration Item. 

Request

URL

POST https://{server_name}/m24Services/api/data/objects/{ciName}

URL attributes 

Element Description Type Required
ciName Technical name of the Configuration Item (e.g. for Incident is "SPSActivityTypeIncident") string Required

Headers

For a list of available HTTP request headers see Web Services: REST API integration.

POST body

The JSON object of the following format. 

{
   "DataDefinition1":{
      "Attribute1":"cf060d4d-5c47-462f-b5d1-7df6c865fd91",
      "Attribute2":null
   },
   "DataDefinition2":{      
      "Attribute3":"TCK00002",
      "Attribute4":"9999-12-31T23:59:59.997Z"
   },
   "MultiFragmentDataDefinition1":[
      {       
         "Attribute4":"Name 1"
      },
      {       
         "Attribute4":"Name 2"
      },      
   ]
}

If needed it is possible explicitly set IDs for the created Object or related fragments. If IDs are omitted in the Request, they are auto-generated

Response

Guid. ID of the Created Object

Status codes and errors

Code Message
401 Unauthorized
415 The request Content-type is not defined
500 Internal Server Error. E.g. wrong reference, or mandatory attribute is missing 

 

 

Examples

Example 1:  Create the Incident 

The following request creates the Incident 

POST https://{server_name}/m42Services/api/data/objects/SPSActivityTypeIncident/ HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer {token}

{     
   "SPSActivityClassBase": {
     "Subject":"Incident created over Public API 2",
      "Category":"42b49002-fed3-4c9b-9532-cf351df038cf",     
      "Urgency":3,
      "Impact":3,
      "DescriptionHTML":"Description of the Incident"
   },
   "SPSActivityClassUnitOfWork":[
      {
         "TypeID":"fe098714-ac94-47f1-9724-df5bac86b3fb",
         "OriginalSolutionHtml":"Created by Public API",                 
         "ActivityAction": 0,
         "CreatedDate":"2019-03-20T16:44:33.67Z"        
      }
   ]
}
  • Was this article helpful?