Recent searches
No recent searches
Error while creating automation from custom app
Posted Dec 30, 2022
I am trying to create an automation from within the custom app, I am following the documentation on Support Site. The script works on Postman, but when I try from the custom app it gives the below error :
Error {"error":"RecordInvalid","description":"Record validation errors","details":{"base":[{"description":"Invalid conditions. You must select at least one condition."}]}}
below is the code that I am executing.
var _url = '/api/v2/automations.json';
var settings = {
url: _url,
type: 'POST',
dataType: 'json',
async: false
};
var _data = { "automation": { "title": "Roger Wilco", "all": [{ "field": "status", "operator": "is", "value": "open" }, { "field": "priority", "operator": "less_than", "value": "high" }], "actions": [{ "field": "priority", "value": "high" }] } };
if (_data) {
settings.data = JSON.stringify(_data)
}
client.request(settings).then(
function (data) {
console.log("Automation created" + data)
},
function (response) {
console.error(" Error " + response.responseText);
//console.log(response);
});
0
2
0 comments
Sign in to leave a comment.