In Python, I used the following endpoint to try to get the access token and move on to get APIKEY in the next step, sandbox merchant is logged in before start:
SB_HOST = https://sandbox.dev.clover.com
SB_MID = Sandbox MerchantID
SB_CLIENT_ID = Sandbox APP ID (installed by SB_MID)
url = "{}{}{}?client_id={}".format(SB_HOST, "/oauth/merchants/", SB_MID, SB_CLIENT_ID)
response = requests.get(url)
The url will look like the following:
https://sandbox.dev.clover.com/oauth/merchants/89XXXXB5691?client_id=7HXXXXWBJ
Two things I tried:
1) Copy and paste the URL and run it in a browser, and It will redirect me to the site preset in APP setting.
2) Run in Python, and response.text gives me a HTML page
Here is the question:
When I run it in a browser, the address bar shown the following:
I used the access token shown in the address bar of the browser and test it in
https://docs.clover.com/clover-platform/reference/keys#getapikey
and get a 200 Response and gives me a JSON response:
{"apiAccessKey": "e1560xxxxxxxxxyyyyyyyf03523f1"
"merchantUuid": "89XXXX5691"
"developerAppUuid": "7HXXXXWBJ"
"active": true
"createdTime": 1587829007000
"modifiedTime": 1587829007000
}
This shown the access token is valid.
But, when I do it programatically, I cannot get the
same as shown in the browser. If I can do it, I can programatically parse the access token from the string.
Am I doing something wrong? Please keep in mind this is ecommerce, NOT web app.