-
hello, i have been trying to upload an image to a draft listing using python and i keep getting the same error message, Thank you for the helpers !!!! |
Beta Was this translation helpful? Give feedback.
Answered by
yarinc99
Apr 22, 2023
Replies: 1 comment 7 replies
-
Hey @yarinc99 , Any luck with this? |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import requests
auth_headers = {'Authorization':f"Bearer {access_token}",'x-api-key':API_KEY}
with open('image.jpg', 'rb') as f:
image_data = f.read()
files = {'name':'image.jpg','image': ('image.jpeg', image_data, 'image/jpg')}
r3 = requests.post(f'https://openapi.etsy.com/v3/application/shops/{shop_id}/listings/{listing_id}/images',files=files,headers=auth_headers)