question

mahlerfive avatar image
mahlerfive asked chanel Deactivated answered

API tokens no longer work in sandbox - giving 401

All of a sudden my sandbox API tokens stopped working this morning. They were working just hours ago.

I tried regenerating a new token by going through the OAuth flow again and hitting the oauth/token endpoint to get a new one. It returned an API token but none of my calls work with it - they all return 401 Unauthorized. I tried this several times with no success.

I also triple checked the merchant ID to make sure I wasn't requesting data for the wrong merchant.

I did notice that this morning the clover API docs changed. I'm wondering if this is some breaking change that rolled out this morning? Is there anything else I can try?
SandboxAPI Token
6 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zgreathouse avatar image zgreathouse commented ·

(The docs changing would have no effect on anyone's API tokens)

0 Likes 0 ·
mahlerfive avatar image mahlerfive zgreathouse commented ·

No, I wouldn't think the docs themselves would, but I figured maybe there was an actual API update that might have rolled out at the same time.

0 Likes 0 ·
chanel avatar image chanel commented ·

Hi @MahlerFive

Can you provide the specific call that's giving you the 401?

0 Likes 0 ·
mahlerfive avatar image mahlerfive chanel commented ·

This fails with 401 when I attempt them myself:

https://apisandbox.dev.clover.com/v3/merchants/4NA1S2T4K3ERR/customers?access_token=[token]&limit=5&offset=0

Other calls fail as well from my app which were automated, such as the customers.csv endpoint.

0 Likes 0 ·
chanel avatar image chanel mahlerfive commented ·

Our records indicate that you've changed your permissions as recently as today. Are you still seeing the 401 error?

0 Likes 0 ·
Show more comments
chanel avatar image
chanel Deactivated answered

Taking another look at your query, the merchant ID that you're using is actually your app ID. You'll want to make sure you're using the merchant's ID instead.

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mahlerfive avatar image mahlerfive commented ·

Yes I feel stupid now - that was the problem.

0 Likes 0 ·
zgreathouse avatar image
zgreathouse Deactivated answered mahlerfive commented
Try uninstalling and reinstalling the application on your test merchant. Please let me know if a fetched token after reinstallation still doesn't work.
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

mahlerfive avatar image mahlerfive commented ·

I already tried reinstalling the app on the test merchant which I wrote in the original post. Still didn't work after getting a new token.

0 Likes 0 ·
mahlerfive avatar image mahlerfive commented ·

Just tried reinstalling again and same problem - can get a new api token, can see it has the proper permissions, but get back 401s on my get requests.

0 Likes 0 ·

Welcome to the
Clover Developer Community