question

ntlygens avatar image
ntlygens asked ntlygens commented

how to obtain oauth token from webpage xmlhttprequest

I have a website that I'd like to have list the items from my merchant's inventory.

How do I retrieve the auth_token and use said token to access the API and retrieve my results? I've gone through the Docs over and over to no avail. I keep getting 401 errors.

!!Please help!!

Calling "/oauth/token?" from Single page AngularJs Web App.

OAuth
3 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.

Mark Mullan avatar image Mark Mullan commented ·

Hi,

At what point of the docs have you gotten up to? The request to /oauth/token is made at this point: https://docs.clover.com/build/oauth-2...

Do you have a code?

0 Likes 0 ·
ntlygens avatar image ntlygens commented ·

Hi Ive not gotten the code I'm not getting the response param for the code. My call is sent as the user enters the website using http get "https://sandbox.dev.clover.com/oauth/token?clientid=CID&clientsecret=CST&code=" just as is.

Is this correct? Ive spent days on this.

0 Likes 0 ·
ntlygens avatar image ntlygens commented ·

My flow is as follows:

User hits website. Http request is sent using GET to 'https://sandbox.dev.clover.com/oauth/token?clientid=CID&clientsecret=CST&code=' I dont get a response code. Only get code if i Click on the app in my merchant development window. Would like to get/generate response code on user entering the website and have inventory iterated/a json response, when button clicked for API query

0 Likes 0 ·

1 Answer

sam avatar image
sam Deactivated answered

Hi,

It maybe a bit different because you're using xmlhttprequestwithout a backend but here's a quick video on how to retrieve an OAuth token creating a webapp: https://www.youtube.com/watch?v=6riNP...

I hope this helps.

Best,

Sam

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