question

mw-subscriptions avatar image
mw-subscriptions asked mw-subscriptions answered

401 Unauthorized Error

Hi,
Just started my journey of developing on Clover. Trying to follow the docs carefully but running into issues with sandbox.

When I run the call like 'curl -s https://apisandbox.dev.clover.com/v3/merchants/RC... --header "Authorization:Bearer {api_token}" | python -mjson.tool'

I get '401 Unauthorized' error. I am using the merchant ID from sandbox. And the token, I manually generated from the API tokens under setup.

What am I doing wrong? Can you please help.

Thanks,
Auth
10 |2000

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

mw-subscriptions avatar image
mw-subscriptions answered chanel Deactivated commented
I figured this. In sandbox, by default under pricing the country is not set. Had to go and manually add to show the Preview in App Market link. After that the oAuth worked.

Clover,
Please update the documentation to outline this step. Its not clear.

Thanks
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.

chanel avatar image chanel commented ·
I'm happy you were able to solve your issue.

I've edit your comment to remove the API token. That token should never be shared publicly (even if it's "just" for sandbox environment)!
0 Likes 0 ·
mw-subscriptions avatar image
mw-subscriptions answered
Thanks. Another question. Is there a way to talk to the clover products/orders database without launching from wishing the Clover Dashboard. It seems that the only way to authenticate is to start the app within the dashboard.
10 |2000

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

Welcome to the
Clover Developer Community