question

adam avatar image
adam asked gbm published

401 Unauthorized using API

I have been trying to follow the various threads that I can find when using the API to access my Clover development Merchant information. I am new to using the Clover API and I am trying to understand the full process to use it.

When doing a test using the following URL using my Merchant ID and API Token, I receive the 401 Unauthorized error message.

https://apisandbox.dev.clover.com/v3/... ID]/items?access_token=[API Token]

I followed the instructions for generating the API Token but it still does not work. I am using Chrome if that makes a difference.

One of the things I am having a hard time following is if I need to create an app in order to use the API. If anyone can provide further explanations on how to get started or point me to some good documentation, I would greatly appreciate it.

Overall, I just want to setup a scheduled task to export transactions from my Production account.

Thank you in advance for your help.

10 |2000

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

rachel avatar image
rachel Deactivated answered adam commented

Hi @Adam,

It is possible to create a token for development from the merchant dashboard (per these instructions), but production support for this type of token is being phased out, and you should not rely on this ability in the future (creating a web app that implements OAuth is the forward-looking solution).

Questions to help us move forward:

  • Is https://apisandbox.dev.clover.com/v3/merchants/{mId}/items?access_token={token} still returning a 401?
  • How are you making the API requests? Via cURL, Postman, or in some other fashion?
  • Does the token have the read/write permissions you need? You can check this by visiting API Tokens within the merchant's settings page.

Thank you,

Rachel

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.

adam avatar image adam commented ·

@rachel,

I believe I figured out what I did wrong. When I setup my test Merchant, it appears it was done on the main Clover site. When I logged in, I noticed the URL was www.clover.com. After logging into the sandbox, I was able to create a new Merchant and connect using CURL as well as some sample Python scripts I found on GitHub.

Thank you for responding back and hopefully I can move forward with my development now.

Thanks, Adam

0 Likes 0 ·
gbm avatar image
gbm answered gbm published
Is it a must to have a Clover device to test the API? I am still getting a 401 Unauthorized error even when I have the correct permissions, correct merchant id and correct token.
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