question

stserviceaccount avatar image
stserviceaccount asked stserviceaccount commented

OAUTH 2 returns html

Hello,

Trying to access Clover's API's without using Flask or a web ui. When making a `get` Authorize request using the code below, I am getting a html response back instead of code to then be sent to the token endpoint to get the access_token. The app is created in the NA sandbox environment. The statusCode is 200. Am I missing something in the code?

import requests
import json

client_id = ''
client_secret = ''
url = f'https://apisandbox.dev.clover.com/oauth/v2/authorize?client_id={client_id}'

response = requests.get(url)
statusCode = response.status_code
code = response.text #returns html instead of code/url/token


REST APIOAuthAPI 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.

1 Answer

·
stserviceaccount avatar image
stserviceaccount answered stserviceaccount commented

After reading some posts, I understand that this authorization endpoint is for merchants to authorize our app, but my end goal is to only access clover's API's/data by passing in the relevant query parameters. Is that even possible without using flask/browser/redirect url's or via a (test)merchant logging in? Is it possible to directly access clover's api's?

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.

parquet76 avatar image parquet76 commented ·

The merchant must grant you access to their data which is what the oauth flow is for.

0 Likes 0 ·
stserviceaccount avatar image stserviceaccount parquet76 commented ·

Got it. Thank you!
I was hoping there was a way to access api's by just getting an accessToken without a merchant's manual authorization

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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