logo

Are you need IT Support Engineer? Free Consultant

Use Media Service in Yaas

  • By Sanjay
  • 08/05/2026
  • 41 Views


The Media service in Yaas could be used to store your media files. Here we will try it step by step.

1. Subscribe the Media service in your dev team.

Use Media Service In Yaas - Sap Consulting India | Saptix

2. Create a new service in your dev team with the scope “hybris.media_view” and “hybris.media_manage”.

Use Media Service In Yaas - Sap Consulting India | Saptix

3. Get the “Client ID” and “Client Secret” of your service. And the “Identifier” of your dev team as the tenant.

Use Media Service In Yaas - Sap Consulting India | Saptix

Use Media Service In Yaas - Sap Consulting India | Saptix

4. Execute the following command in your cmd window to get the token. PAY ATTENTION that the red part should be changed to your own id and secret.

curl -i -H “Content-Type: application/x-www-form-urlencoded” -X POST -d “grant_type=client_credentials&scope=hybris.media_manage hybris.media_view&client_id=xxxxxx&client_secret=xxxxxhttp://api.yaas.io/hybris/oauth2/v1/token

Use Media Service In Yaas - Sap Consulting India | Saptix

5. To upload a file to media repository, firstly we need to send a post request to https://api.yaas.io/hybris/media/v2/files to get the upload link and commit link. PAY ATTENTION that for the Authorization part, the token should be started with “Bearer”. The body indicates that the type of the file that you want to upload.

{

    “Content-Type”: “application/vnd.ms-excel”

}

Use Media Service In Yaas - Sap Consulting India | Saptix

Use Media Service In Yaas - Sap Consulting India | Saptix

Then you will get the upload link and the commit link as response. The upload link is used to upload the file. After that the file is temporally stored in media repository. You need to send a request to the commit link to make the uploading finalized.

Use Media Service In Yaas - Sap Consulting India | Saptix

6. Send a put request to the upload link to upload the file.

Use Media Service In Yaas - Sap Consulting India | Saptix

Use Media Service In Yaas - Sap Consulting India | Saptix

7. Send a post request to the commit link to commit the file. Then you will get the id and link of the media file.

Use Media Service In Yaas - Sap Consulting India | Saptix

8. You can get the real download link of the file by sending a get request to the link.

Use Media Service In Yaas - Sap Consulting India | Saptix

Use Media Service In Yaas - Sap Consulting India | Saptix

9. To see the list of the files in your media repository, you can send a get request to https://api.yaas.io/hybris/media/v2/files?tenant=congdevteam, PAY ATENTION that the red part should be changed to your own tenant.

Use Media Service In Yaas - Sap Consulting India | Saptix



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *

Chat with us on WhatsApp!