Unable to get file xml file content

we are unable to get actual uploaded file content from the repository


getting this basic information or code like this “e4daf8ad368b2f731e55828cd25f6bf5”

Can you please help me out how to get the actual file content using nexus rest api calls

Hi - The API will allow you to download the file, from there you would need to use a different API to open the actual file and read the contents. In your example, since this is an XML file, you could use any XML library for the language of your choice to open it and read it.

The REST API will return the download URL as part of the JSON response. Use this to download the file and read it. You can use the Asset API Assets API to get this information if you already know the id of the file.

If you don’t know the id you will have to use the LIST API Assets API to get the list of assets, and go through the JSON response to find the asset you are looking for. In your example, you could look to match the ‘path’ key in the JSON response to “g1/a1/maven-metadata.xml”.

Hope this helps!