How to upload JSON asset using Asset API | Community
Skip to main content
Level 2
Jul 16, 2020 8:06 AM UTC
Solved

How to upload JSON asset using Asset API

Hi. I am using AEM Assent API and trying to upload a binary file using HTTP request.

 

Here you can find the docs: https://docs.adobe.com/content/help/en/experience-manager-65/assets/extending/mac-api-assets.html#create-an-asset

 

It's working for images but for every json files i am uploading, it's creating new directory with name of the file instead of uploading this file. Any suggestions? How the request should looks like?

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
VeenaVikraman
VeenaVikramanAccepted solution
New Participant
Jul 29, 2020 7:15 PM UTC

@matstyler Thanks for following up. I tried this out.  When we give Content-Type : "application/json" , it is creating a folder , So I tried with a generic type as Content-Type:"application" and it worked ✌😉

Even though it throws me error , file actually got uploaded 

 

 

Hope this works for you ✌

Thanks

Veena

 

11 replies

VeenaVikraman
VeenaVikramanAccepted solution
New Participant
Jul 29, 2020 7:15 PM UTC

@matstyler Thanks for following up. I tried this out.  When we give Content-Type : "application/json" , it is creating a folder , So I tried with a generic type as Content-Type:"application" and it worked ✌😉

Even though it throws me error , file actually got uploaded 

 

 

Hope this works for you ✌

Thanks

Veena

 

Translate
MatStylerAuthor
Level 2
Jul 30, 2020 9:02 AM UTC
Yeah, it's working but returning the error so it's not a good solution but a hack.
Translate
Employee
Jul 16, 2020 9:19 AM UTC

 

If I understand you correctly are you are trying to create an asset outside any folder , and  are seeing that the curl command is creating a folder instead of a node name?

Translate
MatStylerAuthor
Level 2
Jul 16, 2020 10:00 AM UTC
It's working with images (uploading an image) but not for jsons.
Translate
VeenaVikraman
New Participant
Jul 16, 2020 8:34 AM UTC

Hi @matstyler 

 

   Recently I tried out Asset API myself and tried to put it in a video for others if it helps. Please check it how to upload asset here https://youtu.be/NL-2WqitHUE?t=835 

 

Hope this helps

Veena ✌

Translate
MatStylerAuthor
Level 2
Jul 16, 2020 9:34 AM UTC
It's ok for images but when i am uploading json this way it's creating a directory, not uploading the json file.
Translate