# Need to add image prodcut via api but while creating media just create a blank page

**URL:** <https://forum.shopware.com/t/need-to-add-image-prodcut-via-api-but-while-creating-media-just-create-a-blank-page/65214>\
**Category:** Shopware Playground - API first Sandbox\
**Tags:** customelements, shopping-worlds, widgets\
**Created:** [4. März 2020 um 12:50 UTC](https://forum.shopware.com/t/need-to-add-image-prodcut-via-api-but-while-creating-media-just-create-a-blank-page/65214 "2020-03-04T12:50:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiju](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@jiju](https://forum.shopware.com/u/jiju)\
**Post date:** [4. März 2020 um 12:50 UTC](https://forum.shopware.com/t/need-to-add-image-prodcut-via-api-but-while-creating-media-just-create-a-blank-page/65214/1 "2020-03-04T12:50:33Z")

</div>

/api/v1/media

This is the api {“title”:“some title”,"[https://picsum.photos/200/300":"",“fileNamefileName”:{“fileName”:"good](https://picsum.photos/200/300%22:%22%22,%22fileNamefileName%22:%7B%22fileName%22:%22good)}} please help me,i need create media with image

---

<div class="post-metadata">

**Author:** ![imranbajwa](https://avatars.discourse-cdn.com/v4/letter/i/e0b2c6/32.png) [@imranbajwa](https://forum.shopware.com/u/imranbajwa)\
**Post date:** [4. Mai 2020 um 09:13 UTC](https://forum.shopware.com/t/need-to-add-image-prodcut-via-api-but-while-creating-media-just-create-a-blank-page/65214/2 "2020-05-04T09:13:10Z")

</div>

There are 2 step required to add an image to media

1. Create a media id by sending post request to Media with MediaFolderId like this

[www.example.com/api/v1/media?\_response=true](http://www.example.com/api/v1/media?_response=true)

with body&nbsp;

{  
&nbsp;&nbsp; &nbsp;„mediaFolderId“: „aa387d75254946bdbd27cb018e433da0“  
}

you will get the response with id which will be act as mediaId.

1. Now you have to post media using this id

[http://www.example.com/api/v1/\_action/media/fbb9048e53d6485f9f77f28458aea98f/upload?extension=jpg&fileName=myImage](http://www.example.com/api/v1/_action/media/fbb9048e53d6485f9f77f28458aea98f/upload?extension=jpg&fileName=myImage)

and with body

{  
&nbsp;&nbsp; &nbsp;„url“:„[https://upload.wikimedia.org/wikipedia/commons/8/8b/BD\_4C\_Cartoon\_(PSF).jpg](https://upload.wikimedia.org/wikipedia/commons/8/8b/BD_4C_Cartoon_%28PSF%29.jpg)“  
&nbsp;&nbsp; &nbsp;  
}

and thats it.
