Getting "Escalation Policy must be a hash" error when attempting to create Escalation Policy with V2 API through Curl

rest-api
(Ananth Makaram) #1

I am unable to send this JSON object through… as the documentation does not match the schema spec…
JSON Payload below -

Please help! Error Message below -
{
“escalation_policy”: [
{
“type”: “escalation_policy”,
“name”: “AnanthDemo2_EscalataionPolicy”,
“escalation_rules”: [
{
“escalation_delay_in_minutes”: 30,
“targets”: [
{
“type”: “user_reference”,
“summary”: “Joe”,
},
{
“type”: “user_reference”,
“summary”: “Jack”,
}
]
},
{
“escalation_delay_in_minutes”: 30,
“targets”: [
{
“type”: “user_reference”,
“summary”: “Mike”,
},
{
“type”: “user_reference”,
“summary”: “ananth makaram”,
}
]
}
],
“services”: ,
“num_loops”: 1,
“teams”: [
{
“type”: “team_reference”,
“summary”: “moonshotdeltatwo”,
}
],
“description”: “”,
“privilege”: null
},
],
“limit”: 25,
“offset”: 0,
“more”: false,
“total”: null
}
{
“error”: {
“message”: “Invalid Input Provided”,
“code”: 2001,
“errors”: [
“escalation_policy must be a Hash”
]
}
}

(Andra) #2

Hey Anath!

I noticed there were some trailing commas included there which were causing some syntax errors. Can you give the below JSON a try, and let me know if you’re still having any trouble?

{
	"escalation_policy": [{
		"type": "escalation_policy",
		"name": "AnanthDemo2_EscalataionPolicy",
		"escalation_rules": [{
				"escalation_delay_in_minutes": 30,
				"targets": [{
						"type": "user_reference",
						"summary": "Joe"
					},
					{
						"type": "user_reference",
						"summary": "Jack"
					}
				]
			},
			{
				"escalation_delay_in_minutes": 30,
				"targets": [{
						"type": "user_reference",
						"summary": "Mike"
					},
					{
						"type": "user_reference",
						"summary": "ananth makaram"
					}
				]
			}
		],
		"services": [],
		"num_loops": 1,
		"teams": [{
			"type": "team_reference",
			"summary": "moonshotdeltatwo"
		}],
		"description": "",
		"privilege": null
	} ],
	"limit": 25,
	"offset": 0,
	"more": false,
	"total": null
}