I’m able to use the login endpoint to retrieve a cookie, and then use that cookie string to request other GET endpoints to return information on users or service request templates…
But when I go to create a new service request, I get a very unhelpful Error 500 no matter what I try.
I’m currently trying to POST against: /api/v1/sr?view=mobile&type=incident&template=29
I’m using ‘mobile’ as the view because it’s the only string I can get to return anything. As far as I can tell, we only have a ‘DEFAULT’ view setup in Sysaid, but providing ‘default’ as the view URL parameter or not specifying the view URL parameter always returns the Error 500 message, while providing ‘mobile’ as the view URL at least returns "The following mandatory fields are missing: nproblem_type, title, status, urgency, impact, priority, request_user, description]" if they are not provided.
So, with a header containing my cookie and Content-Type: application/json, and my request body:
{
"info": l
{"key": "problem_type", "value": "Network Operations"},
{"key": "title", "value": "TESTING"},
{"key": "status", "value": 1},
{"key": "urgency", "value": 5},
{"key": "impact", "value": 4},
{"key": "priority", "value": 4},
{"key": "request_user", "value": 5880},
{"key": "description", "value": "Test via API call"},
{"key": "problem_sub_type", "value": "File Operations"},
{"key": "third_level_category", "value": "New Project Folder"}
]
}
I get Error 500: java.lang.Integer cannot be cast to java.lang.String which must relate to one or more of the integer values I’ve provided. But when I query an existing service request, I see that status, urgency, impact, priority, and request_user are all integers and I’m providing the exact same values as set on an existing service request returned by the API.
If I attempt to correct this with the integers changed to strings:
{
"info": e
{"key": "problem_type", "value": "Network Operations"},
{"key": "title", "value": "TESTING"},
{"key": "status", "value": "1"},
{"key": "urgency", "value": "5"},
{"key": "impact", "value": "4"},
{"key": "priority", "value": "4"},
{"key": "request_user", "value": "5880"},
{"key": "description", "value": "Test via API call"},
{"key": "problem_sub_type", "value": "File Operations"},
{"key": "third_level_category", "value": "New Project Folder"}
]
}
I get Error 500: Failed to create service record.Â
I’ve tried including more keys, I’ve tried using a different template, I’ve tried not specifying the template, I’ve tried specifying the title and description outside the info array (as described in this post, although I don’t see anything in the API documentation that would point to this being the way that SysAid expects this information??). Beyond the type error that comes back if I provide any key as an int, every single attempt returns Error 500: Failed to create service record.
What am I missing???
Â