Api calls & return code zero, but Adalo says error

Hello,

I’m encountering this error on an API call that returns code zero and the LOG is shown correctly with the useful DATA in the response.

But adalo says there is a mistake … does anyone know what caused it? Should Zero be okay or not?

Response:

i Add DATA in key but nothing…The documentation says:

this is the record log of api calls (The call seems to be successful)

Is it an Adalo problem?

Hi,
In this case, seems your key is actually “BTC” and the “data” is just the object map. Could you make a test with “BTC”?

Hi @miticobeppe,

Add data and BTC for the results key and try.

Thank you

I tried like this … what do you mean? @JL_LJ @dilon_perera

I also tried entering BTC in the key … but nothing

Add a 2nd results key. Like this :

Ok great … but by doing so I will not be able to change the crypto currency I want to get back …

What if I want to call ETH? Or others? where do i enter the parameter in the app?

So it’s a static call, to which I can’t change the parameters

Unfortunately seems Magic Text is not available for Result Keys. I would recommend creating a feature request for this.

1 Like

This is necessary for dynamic calls!..Very disappointed…Thanks

Just leaving this here - could be useful for someone.

I don’t think you’ll be able to connect CoinMarketCap metadata endpoint as an external collection. It’s not about magic text though - I believe it is related to API reply structure.

Here is the reason: API returns the currency data based on $key, which has been specified in the query params. If you use “id” as a key, then the request will look like this (example for bitcoin and ethereum):

GET https://pro-api.coinmarketcap.com/v2/cryptocurrency/info?id=1,1027

And the reply like this:

If you request using Symbol, the request will look like this

GET https://pro-api.coinmarketcap.com/v2/cryptocurrency/info?symbol=BTC,ETH

And in the reply instead of ID you’ll see the symbol:

Screenshot 2022-04-15 at 12.52.07

In my understanding Adalo requires that key names should be the same for each record (which makes sense). For this API it is true for “data” key, but you won’t be able to add the secondary key - as the name are different for each record (BTC, ETH or 1, 1027). That’s why Adalo won’t be able to recognise the reply properly.

As an alternative, you can try to use Custom Actions like here How to get only part of custom action response?, though this could be somewhat cumbersome.

Best,
Victor.

2 Likes

If I had the magic text available, I believe I would have solved it. Because I could introduce within the second RESULT KEY.

It would be enough to manage through magix text within the call parameters the id you want to recall, and insert it again in the second result key. And that’s it. In this way we would be able to make a dynamic call …

Unfortunately this is now not possible for the second result key.

image

Hi,
If you really need this, I can try and make a custom API for free for you. I need so make some dynamic tests to ADALO anyway. DM me the details.

1 Like

Hi @miticobeppe,

In my opinion even in with the magic text it wouldn’t work.
Here is my logic. In other fields magic text is available from logged-in user properties, we can c. Let’s imagine you can add a magic text in the second results key. Then you set a default value there, let it be BTC, and pass the test.
After that, you add a list for this external collection in your app and show it. Let’s imagine you can get the value from some Logged-in User property. The issue is that 2nd results key should be different for every entry in the list: for the 1st entry it should be BTC, for the 2nd - say, ETH, etc.etc. And we’re talking about the key itself, not about value of the key.

I guess that @JL_LJ’s suggestion is the best: if there is a possibility to make custom API - that’s the easiest way to go.

Best,
Victor.

1 Like

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