Can we use javascript in GET ALL results key?

Hi,

Can we use javascript under Get All > Results Key because I’m using an API where I’m not able to call the GET ALL function due to array.

To call the data I need to manipulate things.

Can you share an example of what the response body is structured like that you’re working with?

I just stuck on GET ALL & I’m not able to understand how can i call this

Is there more than on record being returned in the response? There needs to be at least two.

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: https://ideas.adalo.com/feature-requests/p/graphql-support-for-external-collections

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 https://ideas.adalo.com/feature-requests/p/graphql-support-for-external-collections.
@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