I'm sandbox testing following the e-commerce API tutorial from 4/8/20 along with the docs. We are to generate a public key which is used here:
const clover = new Clover('A PUBLIC KEY'); const elements = clover.elements();
The public key comes from core APIs & is generated using the following (my backend is python)
import requests url = "https://apisandbox.dev.clover.com/pakms/apikey" headers = {'accept': 'application/json'} response = requests.request("GET", url, headers=headers) print(response.text)
But I keep getting {"message":"401 Unauthorized"} in my response? I've tried to use the API ID & secret which I find in the sandbox dashboard. The code below comes from here just filling in the box with API ID or secret.
headers = { 'accept': "application/json", 'authorization': "Bearer MY APP ID" }
But I don't find/see any other fields to possible use... can someone assist? Thanks