Hi, guys! I need help integrating the Open Food Facts API into my workout app. I’ve never worked with APIS before so the entire process is new to me. If anyone would be able to offer any assistance, I would be very appreciative! Thanks in advance!
Hi @daisudo31,
Well, first it’s good to learn what is an API and how it works
In Adalo, you can connect to external platforms in 2 ways.
First, there are “External Collections” (see here External Collections with APIs - Adalo Resources). This method is used when you have some kind of a database table (sheet, collection) with multiple records and you’d like to use them in Adalo.
For an Open Food Facts API I can see that searching for a products (call /api/v2/search, the result is a list of products) could be connected to Adalo as external collection.
Another way to connect to external APIs is custom actions (Custom Actions - Adalo Resources). This is used when you need to send something (an object or just a query) to an external API endpoint and receive something in reply (also it could be an object or simple “ok” reply). For instance, you can use Custom Action to send an email: you are connecting to external endpoint, sending the email data (recipient content, body) in custom action request and receive messageID in reply.
For an Open Food Facts API I can imagine that Get product information by barcode (GET /api/v2/product/{barcode}) should be done with Custom Action. You might need to use 3rd party platforms for complex API calls though (e.g. Adalo can’t recognise barcode by itself).
For an API calls testing, I would highly recommend using Postman - it helps a lot.
World of APIs is huge and every API has its own differences, although there are common principles. It is difficult to explain everything in one forum post but I hope I’ve given some info to start.
Would you prefer having a 1:1 consulting session, please don’t hesitate to send me message directly.
Best,
Victor.