Data from external API problem

I’ve been trying to figure out why one of my external data sources does not work in the app. The API itself seems to work fine and testing it in the compose (web) gives proper JSON data as an output. However, when I try to bind and use that data in the app, it stays as “undefined”.

I’ve been debugging it from various angles. Now it turns that my clone of the API no longer gives the JSON data. What I did was cloned the external data API and also kept the original. The original API gives proper output when testing it (GET RECORD), but still cannot use it in the app. The cloned identical API access however, gives an “TypeError. Resource settings for Get record (GET)” Both the Datas are the same for each parameter.

Any idea what’s the problem here and how to fix it? Testing the same API in the AWS (it’s defined there) gives no errors and results in proper looking JSON as well…

Are you still experiencing this issue? This problem doesn’t sound familiar at all, so I would need to ask around and probably have a look at your app, if you are ok with providing me with the app id or the app id of an app with a similarly failing setup.

Yes, the problem is still there. There was a CORS-related issue at the API end, which is now fixed. However, in one app (using this API) I have two data integrations with exactly the same parameters. One of those is retrieving updated data from the API properly, but the other one is not. Gives “Error: TypeError: Type error”. Another test app which I made, also has exactly the same parameters for accessing the data. It also gives the same Type error.

Actually, there is one difference. The API working has schema already set and it works. The other ones have no schema, do not work and hence no automatic schema can be set.

Type error points to the data resource configurator not being able to parse the incoming response. Are you sure that the non-working API is returning proper JSON and with content-type: application/json?

If that’s not it, I could take a look if it’s possible to give temporay access (privately) to the non-working endpoint.

The JSON returned from the API is properly validated JSON (just double-checked). This data is the same for the working and non-working API. I can give you temporary access to the endpoint.

Here is an example:

{
  "statusCode": 200,
  "body": {
    "numberOfTrades": 4380,
    "last_trade_time": "2020-07-16 00:00:00",
    "change_pct": -1.6653,
    "ticker": "UPM",
    "sectorID": "1700",
    "sector": "Basic Resources",
    "open": 23.95,
    "volume": 1221332,
    "day_change": -0.4,
    "close": 23.62,
    "isin": "FI0009005987",
    "low": 23.45,
    "date": "2020-07-16",
    "numberOfShares": 533735699,
    "high": 24.03
  }
}