3

I´m currently trying to automate my shop. That´s why I wanted to add items to my store via discogs api. I tried the official discogs client for python at first but it looks like there is no way to add new items. I only was able to make requests, delete or edit existing items. Then I tried to make my own post request with the following code but I always get a Response 422:

import requests
from requests_oauthlib import OAuth1

auth = OAuth1('YOUR_APP_KEY', 'YOUR_APP_SECRET',
              'USER_OAUTH_TOKEN', 'USER_OAUTH_TOKEN_SECRET')
mydata = {'release_id': 9093239, 
          'condition': 'Mint', 
          'sleeve_condition' : 'Mint', 
          'price' : 5.68, 
          'status' : 'For Sale'}
result = requests.post("https://api.discogs.com/marketplace/listings", json=mydata, auth=auth)
print(result)

or a Response 400:

result = requests.post("https://api.discogs.com/marketplace/listings", data=mydata, auth=auth)

I would be very thanksful if someone could pointed out what I do wrong. Thanks to everyone for reading.

All the best

cpow

cpow
  • 476
  • 4
  • 8

0 Answers0