Trouble with API responses

197 Views Asked by At

This is slightly niche since it focuses on the Discogs API, but I'm hoping someone on this more active forum might have experience with it.

I'm working on a data engineering problem to try and reduce inventory lag. my goal is to pull my inventory here into Shopify, and then when something sells in store, pull it from discogs.

Things I've got working:

  1. pulling my inventory into airtable
  2. Zapier then creates new 'products' in my Shopify.
  3. Shopify can pull sold items from sales tickets

In theory that should only leave 4. simple POST to marketplace listings to mark as draft or DELETE to remove it.

4 has proven anything but simple.

I've done the oauth flow for my app, and have keys (hence the ability to pull inventory into Airtable), but running

POST https://api.discogs.com/marketplace/listings/11111111?status=Draft&key=key&secret=secret 

gets

You are not allowed to view this resource. Please authenticate as the owner to view this content.

What gives? Similar failings with

DELETE https://api.discogs.com/marketplace/listings/11111111?key=key&secret=secret 

What am I doing wrong? Also looking if anyone has tips on using Zapier's web hooks to do the removals.

1

There are 1 best solutions below

1
On

I'm not familiar with Discogs but your problem seems to be related to some sort of failure while authenticating with Discogs (I assume the problem isn't specific to the marketplace/listings endpoint, rather with any discogs endpoint, correct?)

You mentioned doing the oauth flow for your app, yet in your example you're showing the usage of a key & secret combo. This seems related to the Discogs auth flow which is a different flow.

Citing the Discogs docs,

BUT using the key and secret does not identify the requester as any particular user, and as such will not grant access to any resources users should be able to see on their own account (e.g. marketplace orders, private inventory fields, private collections). You will need to use either of the token options for these resources.

If possible, try to generate a token as suggested by the documentation and see if it solves your issue.