Mikhail
(Mikhail)
November 24, 2022, 4:54pm
1
Hello,
Can you please help me to figure out how should I set up parameter fields of an API method so it will accept this kind of JSON?
{
"deltas": [
{
"date": 1647532662,
"object": "event",
"type": "event.created",
"object_data": {
"namespace_id": "cct42fracyj4lv77loz8n3pd9",
"account_id": "cct42fracyj4lv77loz8n3pd9",
"object": "event",
"attributes": {
"created_before_account_connection": true,
"calendar_id": 31243722414895696
},
"id": "2ymvp6oqys6dqnilamlgly62j",
"metadata": {
"event-type": "Silver invoice",
"message": "Hello Silver"
}
}
}
]
}
Dima
(Dima Vak)
November 24, 2022, 7:53pm
2
Hello @Mikhail
If you set up your Codeless API service with one parameter “deltas” that should look like
And will accept an array of objects as below
[
{
"date": 1647532662,
"object": "event",
"type": "event.created",
"object_data": {
"namespace_id": "cct42fracyj4lv77loz8n3pd9",
"account_id": "cct42fracyj4lv77loz8n3pd9",
"object": "event",
"attributes": {
"created_before_account_connection": true,
"calendar_id": 31243722414895696
},
"id": "2ymvp6oqys6dqnilamlgly62j",
"metadata": {
"event-type": "Silver invoice",
"message": "Hello Silver"
}
}
}
]
But if you want to set up completely the same schema as you described - just add one not required “stub” parameter, and just ignore it in the code.
After that service will accept JSON that you provided.
Regards, Dima.
1 Like
Mikhail
(Mikhail)
November 25, 2022, 2:24am
3
How can I use it to make https calls?
I need to pass values account_id and id, can’t figure it out. I’m using call with STUB
Dima
(Dima Vak)
November 25, 2022, 2:58pm
4
STUB it’s just an empty argument, you don’t need to use it. As I said before: “just ignore it in the code.”
I need to pass values account_id and id, can’t figure it out
If I understand correctly, this values should be in deltas argument.
1 Like
Mikhail
(Mikhail)
November 25, 2022, 3:07pm
5
I was able to get the values by striping the JSON untill it start to look normal.
Can you help me, what should I read to understand this object logic, I’m sure it’s usual code stuff, but I struggle a lit bit with the concept.
Dima
(Dima Vak)
November 25, 2022, 3:29pm
6
You could watch this - Navigating Object Hierarchy in Codeless Programming - YouTube
Also, you will be able to find a lot of information here , but it could struggle you because it’s developer’s documentation.
1 Like