Comment on page
Single Item
Map an id to an object and return just a single item.
Using the same framework from within the Query all Records function, this example will return a single item. Once again this example, will use an Addon to extend the response of the merchant table with the deal table.
In step 1 of creating a new Addon we will add the deal table to the response:
.png?alt=media&token=e2e9b6ea-5bea-4f3c-bdd5-8894720a4e35)
In this example, we are choosing the deal table to add to the response.
Next, we will choose to return the data by a single item.
.png?alt=media&token=33521acb-dda5-40ca-98b3-504e273c259c)
In this example, we are choosing to return the data by a single item.
Next, select how what fields to map the deal table to the merchant database table.
.png?alt=media&token=0cb194e1-6628-433e-9ce6-ff40e92dd16d)
In this example, we are mapping the merchant_id in the deal table to the merchant database table.
Lastly, we hit done, give the Addon a name, and have the option to customize the response. Once finished, the response on the output tab will update to show us the newly extended response:
.png?alt=media&token=bab5161a-30f5-4441-a3ff-497bee135d72)
In this example, we see the response is updated with the Addon.
When we Run & Debug this endpoint, we will see the response is extended with the deal of merchant Addon. In this example, it will only return one single item.
.png?alt=media&token=b4fb0024-8316-4ef9-8b64-a18e08255485)
In this example, when we run the API endpoint with the Addon, the Addon is returning a single deal with the associated merchant record.
Last modified 8mo ago