I am trying to do insert with the third party rest api call.
I set Contracts json like this
JSON
{
"title": "Create Ticket",
"description": "Input items to create a ticket",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"required": [
"employee_username",
"request_detail"
],
"properties": {
"employee_username": {
"description": "employee username",
"type": "string"
},
"request_detail": {
"description": "short description",
"type": "string"
}
},
"additionalProperties": true
}
Output
JSON
{
"type": "object",
"properties": {
"number": {
"description": "incident number from serviceNow",
"type": "string"
}
},
"additionalProperties": true
}
Configuration:
Request : Post
JSON
{
"requestUrlTemplate": "https://myinstance.service-now.com/incident.do?JSONv2&sysparm_action=insert",
"requestType": "POST",
"headers": {
"Content-Type": "application/json",
"Content-Transfer-Encoding": "buffered"
},
"requestTemplate": ""{"sysparm_action":"insert","caller_id":"{input.employee_username}\",\"short_description\":\"{input.request_detail}","category":"NETWORK","subcategory":"WHOLE SITE"}""
}
Response
{
"translationMap": {
"numberValue": "$.records[0].number"
},
"translationMapDefaults": {
"numberValue": ""INC000001""
},
"successTemplate": "{\r\n \t"number":$numberValue\r\n }"
}
When execute, I got the following error
{
"error": "Request JSON object for insert cannot be null."
}
It looks like the parser failed to convert Request JSON string to Request JSON Object. Any idea?