Homey Community Forum

API json help needed

Hi all,

I’m trying to get the value of message.body (“Z 2 ABCweg Voorbeeldstad 012345”) of the following API output in a variable but I’m not that familiar with these things.
I’m currently using “http request flowkaarten” app but I don’t know which values I need to use for parameter 2 and 3 in the “get jsonpath trigger waarde”
Can somebody help me with this ? :wink:
This is the API example output :

[

{
“id”: 3234334,
“created_at”: “2019-01-06T04:47:11.000+01:00”,
“groups”: [
{
“id”: 3,
“name”: “Kring 111”,
“address”: {
“address_line1”: “”,
“address_line2”: “”,
“street_name”: “nieuwestraat”,
“house_number”: “1”,
“postcode”: “1234AB”,
“city”: “”,
“country”: “NL”,
“state”: “”,
}
},
{
“id”: 11,
“name”: “Kring 112”,
“address”: {
“address_line1”: “”,
“address_line2”: “”,
“street_name”: “nieuwestraat”,
“house_number”: “1”,
“postcode”: “1234AB”,
“city”: “Voorbeeldstad”,
“country”: “NL”,
“state”: “”,
}
},
{
“id”: 39,
“name”: “Kring 113”,
“address”: {
“address_line1”: “”,
“address_line2”: “”,
“street_name”: “nieuwestraat”,
“house_number”: “1”,
“postcode”: “1234AB”,
“city”: “Voorbeeldstad”,
“country”: “NL”,
“state”: “”,
}
},
{
“id”: 36,
“name”: “Kring 114”,
“address”: {
“address_line1”: “”,
“address_line2”: “”,
“street_name”: “nieuwestraat”,
“house_number”: “1”,
“postcode”: “1234AB”,
“city”: “Voorbeeldstad”,
“country”: “NL”,
“state”: “”,
}
},
{
“id”: 25,
“name”: “Voorbeeldstad Noord”,
“address”: {
“address_line1”: “”,
“address_line2”: “”,
“street_name”: “nieuwestraat”,
“house_number”: “1”,
“postcode”: “1234AB”,
“city”: “Voorbeeldstad”,
“country”: “NL”,
“state”: “”,
}
}
],
“message”: {
“received_at”: “2019-01-06T04:47:11.000+01:00”,
“comments”: null,
“complainant_name”: null,
“location”: null,
“business”: null,
“call_type”: null,
“units”: null,
“sub_address”: null,
“body”: “Z 2 ABCweg Voorbeeldstad 012345”,
“address”: {
“address_line1”: null,
“address_line2”: null,
“street_name”: “ABCweg”,
“house_number”: null,
“postcode”: null,
“city”: “Voorbeeldstad”,
“country”: “NL”,
“state”: null,
}
},
“address”: {
“address_line1”: null,
“address_line2”: null,
“street_name”: “ABCweg”,
“house_number”: null,
“postcode”: null,
“city”: “Voorbeeldstad”,
“country”: “NL”,
“state”: null,
}
}
]

Hi

You can get the message body value out by inserting the $.message.body into the JSONpath field.

For more testing you can do in https://jsonpath.com/
Note that you have to change all the quotation marks in your example if you use the link above to test.