question

jcampbell avatar image
jcampbell asked jcampbell commented

sandbox access_token

I'm generating access_tokens using the sandbox environment, but I'm unable to make api calls using the generated access_tokens. The access_tokens do not show in the Setup=>Api Tokens for the merchant. If I create and access_token using Setup=>Api Tokens then I'm able to successfully call the api. Are the sandbox generated access_tokens not usable for the api calls in the sandbox environment or am I missing something?
REST APIAPI Token
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.

sam avatar image sam commented ·

By generated access_token, do you mean you created and installed an app onto a test merchant, then went through the OAuth process to create an access_token? Did you make sure you had the proper permissions set on the app? Does the merchant at which you're making the call have the app installed?

0 Likes 0 ·

1 Answer

jcampbell avatar image
jcampbell answered jcampbell commented
Thanks for the reply, Sam. Yes, I created and installed the app onto a test merchant and then went through the oauth process to create a token. I then attempt to create a new Order using the access token, but get a 401 back from the REST Api. I'm able to create orders if I revert to the access_token that I created via Setup=>Api Tokens. It looks like everything is setup correctly (app, merchant, permissions), but I must be missing something.
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.

sam avatar image sam commented ·

Yes, sounds like you have everything you need. Two things I would check are, make sure permissions for the app is set correctly in the App's settings. Second is, once the permission is setup correctly, reinstall the app on the test merchant. The new permissions will need to come down to the api token by reinstalling.

0 Likes 0 ·
jcampbell avatar image jcampbell sam commented ·

Reinstalling the app on the test merchant fixed the issue. Thanks for the help, Sam!

0 Likes 0 ·

Welcome to the
Clover Developer Community