Loading

How To Download Files from an Exchange Asset via the Exchange Experience API v1

Udgivelsesdato: Mar 2, 2024
Trin

CONTENTS

You are using version 1 of the Exchange Experience API. Here is how to download files associated with an asset via the API.

Related queries
1: Need to retrieve previous deployed application jar file to compare it with the current one. How to download application jar file from RTF?


STEPS TO FOLLOW

1) Via the Exchange Experience API, you can obtain more information by calling the Asset Version endpoint (documented here).

Here is an example API call:
curl -L -X GET 'https://anypoint.mulesoft.com/exchange/api/v1/assets/<group id>/<asset id>/<asset version>/' -H 'Authorization: Bearer <redacted>'
 If you want to see all versions
curl -L -X GET 'https://anypoint.mulesoft.com/exchange/api/v1/assets/<group id>/<asset id>/' -H 'Authorization: Bearer <redacted>'
For example
curl --location --request GET 'https://anypoint.mulesoft.com/exchange/api/v1/assets/3e767c83-f7a7-4922-8d21-1a5297c5ef3c/my-muleapp-api/' \
--header 'Authorization: Bearer 494d5e40-b9c5-4c7f-8ef7-3bdc5d65b137'

You will see the direct link to download the files. Here is a snippet of the return JSON with the file information (if present):
 
"files": [
{
"classifier": "raml",
"packaging": "zip",
"downloadURL": "https://anypoint.mulesoft.com/exchange/files/api/v1/organizations/org.mule.modules/assets/org.mule.modules/asset-with-files/2.0.0/raml/zip",
"externalLink": "http://localhost/org.mule.modules/asset-with-files-2.0.0-raml.zip",
"md5": "d2dd14a6cbbb15869105d9755d2f8345",
"sha1": "d2dd14a6cbbb15869105d9755d2f8345",
"createdDate": "2020-09-08T16:44:03.861Z",
"mainFile": "instagram-secure.raml",
"isGenerated": false
},
Or
{
            "classifier": "fat-oas",
            "packaging": "zip",
            "externalLink": "https://exchange2-asset-manager-kprod.s3.amazonaws.com/xxxxx/my-muleapp-api.zip",
            "md5": "0737d5c54a8255f41d9c8529ed95466d",
            "sha1": "e35ecdf059c396d6b5864abe757fc62f2adbfa5e",
            "createdDate": "2021-03-22T16:48:11.82Z",
            "mainFile": "api.json",
            "isGenerated": true
        }
Use the externalLink to download the zip file

 
Vidensartikelnummer

001116265

 
Indlæser
Salesforce Help | Article