How to initiate case

1
0
-1

I'm trying to start a case with the following contract (JSON):

{
"inputs": [
{
"inputs": [
{
"inputs": [],
"type": "DATE",
"description": null,
"name": "leaveStart",
"multiple": false
},
{
"inputs": [],
"type": "INTEGER",
"description": null,
"name": "dayCount",
"multiple": false
}
],
"type": null,
"description": null,
"name": "requestInput",
"multiple": false
}
],
"constraints": [
{
"name": "leaveStartIsFuture",
"expression": "requestInput.leaveStart.compareTo(new Date()) > 0",
"explanation": "Leave start must be in the future",
"inputNames": [
"requestInput"
]
},
{
"name": "atLeastOneDay",
"expression": "requestInput.dayCount > 0",
"explanation": "Day count must be greater than zero",
"inputNames": [
"requestInput"
]
}
]
}

I'm having difficulty starting it as I'm always getting a 400 Bad Request.
I'm sending this payload:

{
"requestInput ": {
"leaveStart ": "1477094400000 ",
"dayCount": "12"
}
}

I also tried with no luck:

{
"leaveStart ": "1477094400000 ",
"dayCount": "12"
}

Comments

Submitted by contact_420 on Mon, 10/24/2016 - 19:30

Why you have spaces in json attributes names? Did you try to remove them?

Best regards,
bpms.help

1 answer

1
0
-1

Can you mention which API are you calling?

Comments

Submitted by tcarmo20 on Tue, 10/25/2016 - 10:52

I'm calling the REST API. But I've solved it!
Simply sent the following payload:

{
"requestInput ": {
"leaveStart ": "2016-12-12 ",
"dayCount": "12"
}
}

I thought the date had to be on another format...guess not xD

Notifications