Help for web_api

I don’t know how to use a POST in Web_API. As far as I understand it is necessary to create a JSON file and send it through a POST. Please someone give me a visual example of how to do it.
This is the API documentation:
Customers (ecwid.com)
Thanks!

1 Like

Here are a couple places to start:

1 Like

hello,

you want to do the post customer request ?

1 Like

I thought the same but it doesn’t seem to be like that.

1 Like

The major part of your API is the access token which you need to get it from the system to be able to add/update the data stored.

Are you successful in getting that?

If yes then the rest is just parsing the URL string.

1 Like

Yes I have an access token, but I don’t know how to use the blocks. I tried all the available examples in the community but none of them worked for me. What do you mean in “parsing the URL string.”
These are my blocks. Where am I wrong?

1 Like

What is the response you are receiving from the POST call?

For testing sake, show the response first before checking for error or status.

response - empty
status - 403
error - unknown

1 Like

403 means you do not have access to the data.

2 Likes

I understand! I use the blocks correctly, but the access token I have does not give me access to this data and this is actually my problem.

2 Likes

The documentation shows 2 methods to obtain the access token

  • redirect (callback) URL which is the easiest but require that you catch the redirected token from the called back URL.

  • API get call that you should do before the post call.

1 Like

I do not understand. I have this in the control panel


I use these аccess tokens for authorization.
I think that’s right. Or maybe I’m wrong?

1 Like

Something I don’t understand in the documentation of this service.

The example written is different than the sample code

https://app.ecwid.com/api/v3/14430165/profile?token=123456789abcd

This is the example. The documentation does not mention “profile”.

1 Like

this is a string that determines what information will be searched
profile - basic store information
orders - order data
customers - customer data
etc.
at least that’s how I understand it.

1 Like

Sorry,
There seems to be a problem in the docs. Every time I try to use the “copy button” in the website to copy the text for creating the customer, I got the last copied text.

Anyway, I tried doing the same with postman and I get the same error code. Of course in my situation I know the token is not correct.

If you can use postman to verify that the issue is actually an authorization issue and not Thunkable.

1 Like

will you give me a link to postman

1 Like
1 Like

Thanks

1 Like

403 Token has no required permission CREATE_CUSTOMERS :slight_smile:
Thank you very much @muneer . I will write to Ecwid support for a correct token

1 Like

Just to mention although I know you know it.

The docs mention that POST calls require secret token and will not work with public token.

So if the token used in the call is the public one it would fail.

4 Likes