Solved

API to create service request

  • 6 November 2023
  • 6 replies
  • 241 views

After authenticating I tried to create a service request of type ‘request’ using the API, but keep getting the error “HTTP Status 415 – Unsupported Media Type”.  

Details:

url = https://xxxxxx.sysaidit.com/api/v1/sr?type=request

body:

{
    "subject": "Service Request Subject",
    "description": "Service Request Description",
    "status": "1",
    "assignedTo": "6436",
    "info": [
              {
               "key": "responsibility",
               "value": "6436", 
               "valueClass": "",
               "mandatory": false,
               "editable": true,
               "type": "list",
               "defaultValue": null,
               "customColumnType": null,
               "keyCaption": "Process manager",
               "valueCaption": ""
               }

icon

Best answer by Anonymous 8 November 2023, 10:13

View original

6 replies

Userlevel 1
Badge +1

Hi Thomas,

Please take a look at our documentation on REST API: SysAid REST API Guide.

If you have further questions, don’t hesitate to open a new ticket in our helpdesk.

I used the document you mentioned to get as far as I did.  I was not able to get any further, as I find the document does not provide sufficient information.

Hi @thomas.walker 👋
Here’s the file with the example of the API to create a ticket.

Let me know if this helps!

You may need to set the header value `Content-Type` to `application/json` in order for the api to accept the contents. 

I am now able to create a ticket, but the API seems to ignore some of the input.  It will correctly use the values for title, assigned_group, status, impact, etc . . . but it ignores problem_sub_type and third_level_category.  Any suggestions?

Badge

I am now able to create a ticket, but the API seems to ignore some of the input.  It will correctly use the values for title, assigned_group, status, impact, etc . . . but it ignores problem_sub_type and third_level_category.  Any suggestions?

I believe you have to specify those in the problem_type separated by the underscore, and then delete the lower level categories from your JSON body. I don’t think you can send problem_sub_type directly. It also seems to work the same way when searching/filtering.

Example: If your problem_type is Animal, problem_sub_type is Dog and third_level_category is 1 then your JSON would look like this:

{“key”:“problem_type”, “value” : “Animal_Dog_1”}

I’m assuming that third_level_category is a sub category of problem_sub_type.

 

HTH

Rudy

Reply