Getting 401 unauthorized error code for Clover API request for my web app, but only on SOME requests

28 views Asked by At

I'm building a clover api integrated Flask web app in Python. The flow of the app is:

  1. you go to the website
  2. upload a CSV of your inventory you want to add
  3. the website verifies/cleans your data
  4. you get sent to Clover OAuth to log in to your Clover Merchant account
  5. using the api token generated by Oauth, the website GETs your Merchant's Clover Inventory and stores it
  6. For each item in the CSV, the website checks if the item is in the inventory already or not
  7. If it is, it's supposed to update the stock, if not, it's supposed to create a new item

There's where my problem comes in. The GET requests work perfectly using the API token generated from the OAuth callback. But when I get to the POST requests, I consistently get 401 unauthorized error, but ONLY on the web side of things. Client side or on the Clover API reference website if I make exactly the same request I get 200. And it isn't the token being wrong because the GET requests work. Furthermore, the API token should have full permissions because all API permissions are enabled on my dashboard. And obviously the permissions work because on the client side the requests work. Anyone have any idea? I can provide more information if needed.

I've tried multiple different ways of making the same request, and changed the request json/headers a bunch of different ways etc

0

There are 0 answers