Adding json data to external collection

I’ve a working API in Postman to collect data from the HubSpot CRM system. Now I want to use this API within Adalo but I’m stuck. I don’t know how to add the JSON data to the external collections, any suggestions on how to do this?

JSON Data:

{
“properties”: [“name,address,address2,city,country,description,gps_loaction,hs_lastmodifieddate,type”],
“filterGroups”: [
{
“filters”: [
{
“propertyName”: “type”,
“operator”: “EQ”,
“value”: “PARTNER”
}
]
}
]
}

Can you copy the full CURL code from the postman request? Just hide your API key or any sensitive data ofc

Thanks for your response, the full CURL command is:

curl https://api.hubapi.com/crm/v3/objects/companies/search
–request POST
–header “Authorization: Bearer secret*”
–header “Content-Type: application/json”
–data ‘{ “filterGroups” : [ { “filters” : [ { “propertyName” : “type”, “operator”: “EQ”, “value”: “PARTNER” } ] } ] }’

This is even a better CURL command which I’m trying to achieve. The CURL call is working on the command line as well I’ve it working in Postman.

curl https://api.hubapi.com/crm/v3/objects/companies/search
–request POST
–header “Authorization: Bearer **************************”
–header “Content-Type: application/json”
–data ‘{ “filterGroups”: [ { “filters” : [ { “propertyName” : “type”, “operator”: “EQ”, “value”: “PARTNER” } ] } ], “properties”: [“name,address,address2,city,country,description,gps_loaction,hs_lastmodifieddate,type”] }’

Is this intended to return one company, or would it be a list?

It is a list of companies.

Never tried this but you can give it a go.

  1. Fill in the example JSON body you gave me (as below) with some relevant search data for testing purposes:

  1. Copy and paste everything except for the word data and the outer apostrophes’ ’ into https://www.urlencoder.org/
  2. Change the GET All on the external collection to be POST
  3. at the end of the endpoint, add ?data= and the URLencoded json you got from step 2, so it will look something like the below:

If that returns data, let me know.

Might be worth trying without URL encoding also.

I followed your instructions (with encoding) and no positive results, unfortunately.

This the screenshot with the full( encoded) URL:

This is the result:

As the data is not fully visible in the screenshot I copied the data below:

URL Called:

ttps://api.hubapi.com/crm/v3/objects/companies/search?data=%7B%20%22filterGroups%22%3A%20%5B%20%7B%20%22filters%22%20%3A%20%5B%20%7B%20%22propertyName%22%20%3A%20%22type%22%2C%20%22operator%22%3A%20%22EQ%22%2C%20%22value%22%3A%20%22PARTNER%22%20%7D%20%5D%20%7D%20%5D%2C%20%22properties%22%3A%20%5B%22name%2Caddress%2Caddress2%2Ccity%2Ccountry%2Cdescription%2Cgps_loaction%2Chs_lastmodifieddate%2Ctype%22%5D%20%7D

Full response:

“\n\n<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>\nError 405 Method Not Allowed\n\n

HTTP ERROR 405

\n

Reason:\n

    Method Not Allowed

\n\n\n”

I will no try without using the encoding.

Sorry my mistake, the POST was automatically changed to GET again. Done the test again with POST.

Full URL:

https://api.hubapi.com/crm/v3/objects/companies/search?data={%20"filterGroups"%3A%20[%20{%20"filters"%20%3A%20[%20{%20"propertyName"%20%3A%20"type"%2C%20"operator"%3A%20"EQ"%2C%20"value"%3A%20"PARTNER"%20}%20]%20}%20]%2C%20"properties"%3A%20["name%2Caddress%2Caddress2%2Ccity%2Ccountry%2Cdescription%2Cgps_loaction%2Chs_lastmodifieddate%2Ctype"]%20}

Full response:

“\n\n<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>\nError 415 Unsupported Media Type\n\n

HTTP ERROR 415

\n

Reason:\n

    Unsupported Media Type

\n\n\n”

Can try without url encoding. It’s a bit of a long shot though I didn’t try passing a json structure in url before. If it was my own project I’d make my own endpoint in xano, then use xano to call hubspot.

When using the JSON code without encoding the same result:

Full URL:

https://api.hubapi.com/crm/v3/objects/companies/search?data={ “filterGroups”: [ { “filters” : [ { “propertyName” : “type”, “operator”: “EQ”, “value”: “PARTNER” } ] } ], “properties”: [“name,address,address2,city,country,description,gps_loaction,hs_lastmodifieddate,type”] }

Full response:

“\n\n<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>\nError 415 Unsupported Media Type\n\n

HTTP ERROR 415

\n

Reason:\n

    Unsupported Media Type

\n\n\n”

Why are you suggesting to put “?data=” behind the URL? The data paramater in the CURL command is to specify the data which needs to be included in the POST message. I don’t believe the word data is used to specify the JSON data.

Ok, I’ve not used Xano before, I can check that as well. But the not encoded JSON URL is not working, unfortunately.

1 Like

Xano has a bit of a learning curve but is very powerful. It’s probably worth learning as Adalo are going to be introducing a direct integration with it soon.

But essentially you can make a Xano endpoint which accepts the relevant query parameters, and call it from Adalo. Then you can use the exact request used in postman (xano allows CURL import which is nice), and just feed in the parameters.

THanks for the short explanation. For my better understanding, Adalo connects to Xano and then Xano passes on the URL/Request/etc to my HubSpot CRM, correct?

Adalo => Xano => HubSpot

1 Like

That’s it. And Xano then passes hubspot’s response back to Adalo.

1 Like

Thanks, going to investigate that route as well.

Conclusion is that Adalo is not able to pass JSON data in a POST request, is that correct?

I cannot add more post as I’m a new user :frowning: So I edit the existing post.

Additional question: Would Zapier being something similar as Xano?

Custom action it can, External collection I don’t know of a way.

Zapier, make, integromat I believe can probably achieve the same thing. Xano is more powerful though and what I’m familiar with. I’m not sure I’d be confident having my collections constantly loaded from zapier/integromat - that could get expensive too.

Xano has a cost also, you’ll need a paid version when you get real users to avoid rate-limiting. So be aware when your app is launched you’ll need to pay $60+ per month for Xano.

If you can’t post more as a new user feel free to direct message me.