External collections : how to handle API end points requiring a parameter ({id})?


I’m currently trying to use the Mailjet email API to send campaigns.

Campaign creation is a 2-steps process I do need to complete using eternal actions :

1 - First, I have to create the campaign draft using :
[POST] https://api.mailjet.com/v3/REST/campaigndraft

2 - Once done, I do need to add the content of this campaign (message body), using :
[POST] https://api.mailjet.com/v3/REST/campaigndraft/{draft_ID}/detailcontent

When done, I can send the campaign using hat Mailjet call “an action” :
[POST] https://api.mailjet.com/v3/REST/campaigndraft/{draft_ID}/send

Hereafter the list of problems I’m currently facing :

A - How to use data from a parameters collection (1 row) ?
To create a campaign, I do need to provide the ID of the contacts list. So I’ve created an Adalo collection named “Parameters” where I set a “ListID” value containing the ID of the contacts list (number).
The only way to use this ListID parameter is, when setting the external action for the 1st step of the campaign creation, to use thanks to the magic button the value "Parameters > ListID > Maximum…

Is there any way to get a data value from a collection ?

If not possible, it will be a problem to use Adalo because for my project, I do need admin collections, and these collections will contain only one row of parameters.

B - How to create external actions using an {id} parameter in the end point URL ?
As stated before, to send a request I do need to perform a POST API call to the endpoint : https://api.mailjet.com/v3/REST/campaigndraft/**{draft_ID}**/send , but …
… how can I pass this {draft_ID} parameter in the URL of the external action ?

Many thanks in advance for your feedback !
I really hope there are solutions to my problem, so that I will be able to continue working with Adalo…

Christophe HK


I think we need some step-by-step API tutorials!

1 Like