All PostsDiscussionsBlogsIdeasQuestions
  •                    
  •                    
  •                    
  •                    
  •                    
  •                    
  •                    
  •                    
  •                    
  •                    
  •                    
  •                    
  •                    
  •                    
  •                    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
Discussions
eBay Community logo
  • Home
  • News & Updates
  • Buying & Selling
    • Buying
    • Selling
    • New to selling on eBay
    • Seller Tools
    • Shipping
    • Returns
    • eBay Advertising
    • Payments
    • Mobile Apps
  • Explore Categories
      • eBay Motors
      • Electronics
      • Collectibles & Art
      • Home & Garden
      • Clothing, Shoes & Accessories
      • Toys & Hobbies
      • Sporting Goods
      • Books, Movies & Music
      • Health & Beauty
      • Business & Industrial
      • Jewelry & Watches
      • Specialty Services
      • eBay Partner Network
      • Accessibility
      • eBay Developers Program
      • eBay Cafe
      • eBay Live
      • Community Mentors
    • Ask a Mentor
  • About
    • About the Community
    • Share Community Platform Feedback
    • Report eBay Technical Issues
    • About eBay
  • Community Events
    • Events
    • Seller Circle Hosts
    • Seller Circles
  • eBay Help
    • Special CategoriesChevronRightIcon
    • eBay Developers ProgramChevronRightIcon
    • RESTful Sell APIsChevronRightIcon
    • Marketing, Analytics, MetadataChevronRightIcon
    UploadDocument resta API

    Hello when I upload a documenti with the uploadDocument rest API I get the error "bad request".

    What is the correct payload for the call:

    I am using python requests:

     

                url = f"https://api.ebay.com/commerce/media/v1_beta/document/{document_id}/upload"
                headers = {
                    "Authorization": f"Bearer {token}",
                    "Content-Type": "multipart/form-data"
                }
                # Carica il file
                with open(file_path, "rb") as file:
                    response = requests.post(url, headers=headers, data=file)

     

    I tried with CURL and it works?

     

    What is wrong?

    eternalgroup
    eternalgroup
    Posted 1 year ago · Edited 1 year ago
                                           
             
    0 comments

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
                   
                                                                                     
    •                                                              
    •                                                              
    •