Can we use javascript in GET ALL results key?

yup, data > offerid (but I’m not able to call offerid because there is no variable)

Can I call via javascript because if i use javascript i can call via like [0] (array)

I’m not able to understand how can i call this, if you have any alternative for this let me know it’s URGENT

Can you share a video scrolling through the rest of the request or even just paste the json response here?

You can found the example of JSON response on this link at the bottom https://offer18.gitbook.io/offer18/affiliate-api/affiliate-offers-api

As far as I know the Json response from the api must have a results key in order for Adalo to successfully map it and save the collection.

In your json response before the opening curly bracket you need:

“results”: [
{ then response goes here…

Yes, but the API is not in my hand I can’t edit anything.

Any suggestion @Ben?

Hmm… Looks like an issue of the API not following standard json. data looks like it should be the results key, but the problem is that it should have square brackets after it, not curly brackets.

I’m am poking this topic again. @Ben, are there any plan on being able to pull in data without a results key in the response?

I am attempting to connect to the free gold price api, and they don’t provide a results key in their json response.

https://www.goldapi.io/

I can see the data I need in the response previewer, but just cannot save the external collection without a results key.

@ldyer a results key is not required. The above issue is that there was as key but not properly formated with [ ].

@Ashley, I have to disagree with you on this. I have attempted to connect to multiple APIs that did not have a properly formatted results key, and Adalo will not let you save the external collection without the results key.

@ldyer @ashley Hi Ashley, Luke,
I saw the same what Luke describes. E.g
image
which is a valid JSON, but not a proper REST API response.

There are several APIs out that do provide valid JSON that would be useful to integrate, but do not provide a proper REST API response.
I there a way that we can integrate these by wrapping the response in something like:
{
“response”: [
{JSON received}
]
}

3 Likes

What he said :grimacing::sunglasses::ok_hand:————^

While that may be valid JSON if the API is not a REST API it won’t work with our system. As for the wrapping the response this could be a great feature/component request at Adalo | Feature Requests

@ashley @ldyer @ishantanusrivastava @Ben I just checked in the feature request is already there: GraphQL support for external collections | Voters | Adalo

I could not find it in the specification, but it looks like that the response of a GraphQL API (e.g. ButterCMS) typically looks like the one we are having problems with:
Unlike REST API there are no brackets that are currently expected for external collections in Adalo.

2 Likes

Please upvote the feature request GraphQL support for external collections | Voters | Adalo.
@Ben @jeremy @ashley I spend some time on investigating backend alternatives for Airtable with the goal to have one CMS that can be used by Adalo and UIBakery or similar in parallel (sorry for this, but the desktop apps are still missing to much design/flexbox control).
It looks like that the trend for headless CMS is going from REST API to GraphQL, which definetly makes sense from my point of view (see: https://www.howtographql.com/basics/1-graphql-is-the-better-rest/)

1 Like

I have the same issue with the Google Calendar API. Please Help

Hi @ibrahim.i. Please see the comment above that has a link to the feature request related to this. By adding your upvote there you will be notified when this feature is available.

1 Like

@karimoo Hi did you find any better alternatives for a backend outside of Airtable? I’m getting stuck on trying to create a collection from an Airtable sync from this thread below…

If you got that response from one of your “technical” staff then it is a real worry.

Otherwise, it is not all that helpful as REST is a set of constraints, it says nothing about requiring square brackets.

The square brackets indicate an array. “Standard” JSON not only doesn’t exist but even if it did (which it doesn’t) you don’t need an array.

You chose, one assumes because Airtable works in this way, to force all APIs to return “records” as an array. This is really not the case.

I get this from an “External Collections” perspective (i.e. something that looks more or less like a database).

And I get that JSON is really hard to Parse automatically. Bubble still can’t do {“thing”:[“this”,“that”,“theother”]} after 5 years of moaning. Valid JSON, nightmare to parse.

But pushing it all onto your users as we are “Doing it wrong” feels a little unfair.

There are constraints (must have an array) and some quirks (zeros in a first record’s field) so I think it would be more helpful to detail these rather than having to guess.

So what do you put in the ResultsKey when the data you need is nested? so for instance 3 levels down?

1 Like