Are Thunkable and WalMart API compatible?

I am trying to connect my thunkable app to WalMart web API.

I am reading the docs to connect it and it is saying that HTTP requests will fail.

From Documnets:

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests with an incorrect authentication will also fail and will return a Status Code of 401 .

Link to Docs.

I have tried setting up my headers a thousand different ways. Am I entering something wrong or will the platforms not work together?

I have my headers set up as follows:

 Accept: application/json
 Authorization: Basic <SSID>:<Auth Token>
1 Like

Did you test from a device or the online builder ?

Online gives me a fetch error.

Testing on the live view gives me an “unauthorized” error.

Have you been able to get it to work using something like postman? If not i would start there first.

1 Like

I have never heard of Postman but it is handy. Thank you @zander.

Result from postman cURL call:

    "Status": "ERROR",
    "Message": "Bad credentials"
     Status: 401 unauthorized

From API documents:

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests with an incorrect authentication will also fail and will return a Status Code of 401 .

Looks like it does not work since postman is also sending a HTTP call. Does anyone know if there is a way to send a HTTPS cURL call from Thunkable?

1 Like

So I don’t think its the https issue. I re read the socuments and it looks like its a credentials issue.

API requests with an incorrect authentication will also fail and will return a Status Code of 401

However I found this link that kind of teaches you how to do a https call

2 Likes

You need a conversation tool for your authentication credentials.

You can use Postman if you want. Give it the SSID and Auth Token and Postman would give you an encrypted string which you will need to use in the authorization entry of your header.

3 Likes

I gave poatman Basic Auth tool information. I entered my ssid and auth token. I got the same result in postman as I did in thunkabke.

Status 401.

Am I missing something?

2 Likes

You can easily test if you are missing something or not.

The API is using Basic authentication which means you can run it directly from your browser.

In your browser (Chrome or Firefox or any other) start a new tab and in the browser URL type:

SSID:Auth-code@http://your-api-end-point

So, if your SSID is ryan and your auth code is abcd1234 and your API is http://walmart-api then your URL should be

ryan:abcd1234@http://walmart-api

This should work directly from the browser.

3 Likes

@muneer & @zander

Thank you for sticking with me on this and letting me know I’m most likely wrong in how I was inputting data.

I used Postman for the HTTP diagnosis. On the left side of Postman there is a </> symbol that shares the cURL code. I noticed that the Authorization header was changed from how I was entering it in Thunkable.
I was entering my property as: “Authorization” with value: “Basic SSID:auth-code”. However when I looked at the code in postman it changed it to a long key.

I have no idea how to make this key or where is came from. I’m sure it has something to do with Basic Auth protocols? So to solve it I put my property as: “Authorization” with value: “Basic long-random-key”.

Anyways it is solved thanks to this. I appreciate everyone who helped. Stay tuned for more questions. :rofl:

4 Likes

This is where that long string came from.

1 Like