REST API Name Mapping

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Nick26
Posts: 27
Joined: Fri Aug 07, 2020 6:59 am
Location: Melbourne, Australia

REST API Name Mapping

Post by Nick26 »

I need to map a REST response, as one of the response attributes is "id".

Easy enough to do, until the response is in multiple layers:

"data": [
{
"id": "li_1KH02dIkkadsadvWPN0jw7D9V",
"object": "item",
"amount_subtotal": 0,
"amount_total": 0,
"currency": "aud",
"description": "Freelancer",
"price": {
"id": "price_1KFyx3Ikkcsasdadas",

I have tried data.price.id as the "External Name" in the mapping.

Can anyone help me please!
BobK
Posts: 544
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: REST API Name Mapping

Post by BobK »

I have not had this issue, but I did a quick test and the following worked for me.

Assuming you want to map data.id to dataid and data.price.id to priceid, your mapping would be
mapping.png
mapping.png (1.15 KiB) Viewed 940 times
AwareIM seems to know which BO it is currently creating and which attributes are available.

If you wanted to use the same AwareIM name for both ids, you would only need 1 mapping like
mapping2.png
mapping2.png (1.06 KiB) Viewed 940 times
As long as myid was an attribute in both the data BO and price BO that would work.
Bob
Post Reply