Title: Upload image API REST
Last modified: May 7, 2019

---

# Upload image API REST

 *  [jjtorresg](https://wordpress.org/support/users/jjtorresg/)
 * (@jjtorresg)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/upload-image-api-rest/)
 * hello, I have installed a clean version of wordpress and added woocommerce.
    
   From an ERP I add the products, categories via API REST, all this without problem.
   But when I try to add the images I find several errors that took weeks without
   finding a solution. If I try to add the images when I update the product according
   to the woocommerce documentation ([https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-product](https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-product))
   I receive the error 400. I check the json file that sending via API REST and 
   has the same structure indicated in the documentation. Example {   “name”: “Bicycle
   bh 95b”,   “slug”: “BICYCLE HB”,   “description”: “Biciclet hb dedicated to road.”,“
   short_description”: “Bicycle bh 95b”,   “sku”: “70068”,   “regular_price”: “525”,“
   sale_price”: “”,   “external_url”: “”,   “button_text”: “”,   “tax_class”: “”,“
   manage_stock”: “false”,   “stock_quantity”: “22”,   “stock_status”: “instock”,“
   weight”: “0”,   “shipping_class”: “”,   “average_rating”: “0.00”,   “rating_count”:“
   0”,   “parent_id”: “0”,   “purchase_note”: “”,   “categories”: [     {       “
   id”: “17”     }   ],   “images”: [     {       “src”: “https: // <www.myweb.es
   > /html/wp-content/uploads/2019/04/70068_P1.jpg”     }   ] } With this json I
   receive error 400.
 * I also tried to do it via endpoint media “/ wp-json / wp / v2 / media” to insert
   the image in the media library first and in this case I receive the unauthorized
   401 error. The user with whom I am connecting the API is an administrator. The
   json sent it with the image in binary. The user has passed it as a parameter 
   or adding to the header and I receive the same error.
    I do not know how to upload
   images, to see if you can give me a solution.
 * Thank you.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fupload-image-api-rest%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [bradvin](https://wordpress.org/support/users/bradvin/)
 * (@bradvin)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/upload-image-api-rest/#post-11509179)
 * hi [@jjtorresg](https://wordpress.org/support/users/jjtorresg/)
 * I am not sure how your query relates to FooGallery? Please let me know
 *  Thread Starter [jjtorresg](https://wordpress.org/support/users/jjtorresg/)
 * (@jjtorresg)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/upload-image-api-rest/#post-11509196)
 * Sorry, but it is not related to FooGallery is with wordpress in general, without
   plugin installed.
 *  Plugin Author [bradvin](https://wordpress.org/support/users/bradvin/)
 * (@bradvin)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/upload-image-api-rest/#post-11509230)
 * ok cool – you might want to post this query on the general forum then.
 *  Thread Starter [jjtorresg](https://wordpress.org/support/users/jjtorresg/)
 * (@jjtorresg)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/upload-image-api-rest/#post-11509252)
 * Ok,
 * Thank you

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Upload image API REST’ is closed to new replies.

 * ![](https://ps.w.org/foogallery/assets/icon-256x256.gif?rev=2602542)
 * [Photo Gallery by FooGallery : Responsive Image Gallery, Masonry Gallery & Carousel](https://wordpress.org/plugins/foogallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/foogallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/foogallery/)
 * [Active Topics](https://wordpress.org/support/plugin/foogallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/foogallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/foogallery/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [jjtorresg](https://wordpress.org/support/users/jjtorresg/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/upload-image-api-rest/#post-11509252)
 * Status: not a support question