Has anyone built a plug-in to connect to a POST API?

Hi there!

So i’ve been checking out the Adalo Marketplace and see some great plug-ins on there. I was wondering if anyone here has built a plug-in and then added it to the Adalo Marketplace? There are developer tools on how to do this.

Reason I ask - I have an external API that is POST only. But looks like Adalo wants me to go through all methods (even though I don’t have any, specially GET ALL). So I’m thinking of building my own plug-in that will connect to a third party public API.

I have built an API through sparklite.io - if anyone is interested!

As always, thanks so much for all the help around here

Best,
Sadhana

Hi @sadhana,

If you’re connecting your API as an external collection, you can change the method used for each of 5 requests. This is done on the 2nd screen of external collection setup (e.g. GET ALL shouldn’t necessarily use HTTP GET).

Though in order for the collection to be created, your API must return data in the format which could be recognised by Adalo (JSON with an array of records with a unique ID for each).

Best,
Victor.

Hi @Victor - thanks for the response! I’ve tried to change all the methods to post and add my endpoint to all of them, but I see an error still:

image

image

Hey @sadhana,

This is what I meant when wrote that Adalo should recognise the format.
I don’t see an array of records in your API’s response.

Are you sure you need to use External Collections? The response seems to be suitable for a Custom Action more.

Best,
Victor.

I believe I need a collection to build a custom action right?

Hi @sadhana,

No, you don’t, these are 2 separate things.

External collections are used when you have some data stored elsewhere and you’d like to access it from the app. E.g. you have a table in Airtable with some records and you’d like to work with these records in Adalo in a similar way you work with the built-in collections.

Custom actions are used when you have some external service and you’d like it to perform some action for you: e.g. send an email, get the info about the weather in a town today, etc.

Best,
Victor.

Hi Victor,

Thanks for the reply. I’ve been learning about custom functions a lot in the last two days. However, I have to admit - it’s a bit confusing :confused:

Essentially, I have an API that has one inputs and two outputs. What I’m looking to do is, create an app on Adalo that allows me to create a textbox where I can enter the input and then click on a button. After clicking, I should be able to see the two outputs below the button.

The output should be dynamic.

Is there a specific article I should read? Is it possible to get in touch with the support team for 30 mins and clear all my doubts? Thanks again!

Sadhana

Hi @sadhana,

In your case you will need to set up a Custom Action, see help here: Custom Actions - Adalo Resources.
On the 1st step you need to name your custom action and select “Create” method.
On the 2nd step you put your API’s URL, select the method (you need to know it), in the right pane you add the params which needs to be passed to this custom action, and on the left bottom pane you create a JSON body which will be passed to your API.
On the 3rd step you test this custom action - if everything works fine, Adalo will recognize the parameters in the response automatically.

After that you simply add this custom action, for instance, to a button. On the subsequent actions the results from it will be available.

In regards to the call with Adalo support team - I don’t work for Adalo, so I don’t know :slight_smile: Although I don’t thhink they provide such service.

Best,
Victor.

2 Likes

Hey @Victor - thanks for the detailed steps. I did as you mentioned:

The test was successful. I added the custom action to my button.

But, how do I assign the response values to the two text fields below the button? I have two outputs - “joke” and “punchline”.

Btw - the API call is working:

I have created a custom action called “Facepalm_Rating” and would like to return the two outputs - response_data.outputs.Joke and response_data.outputs.punchline into the two text boxes beneath the button

Hey @sadhana,

The custom action’s output results are available in subsequent actions.

If you need to update text values for labels - easiest way will be to add 2 properties to Users’ collection, add Logged-in User → there properties as a magic text to each label, and update logged-in-user properties after custom action is run.

Best,
Victor.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.