Skip to content

Upload Image using python #923

Closed Answered by yarinc99
yarinc99 asked this question in Q&A
Mar 20, 2023 · 1 comments · 7 replies
Discussion options

You must be logged in to vote

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)

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@yarinc99
Comment options

@rubberfashion
Comment options

@yarinc99
Comment options

@yarinc99
Comment options

Answer selected by yarinc99
@sebing
Comment options

@sebing
Comment options

@sebing
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants