The Marketplace V2 REST APIs are deprecated.
The Marketplace V2 REST APIs (the /rest/2 endpoints, including the marketplace-client-java library and the tutorials in this section) have been deprecated and are being disabled. Requests to these endpoints will fail with an HTTP 410 Gone response and an API_DEPRECATED error. Please migrate to the V3 Marketplace REST APIs. For more details and migration guide, see the changelog (CHANGE-3257).
Example error response:
1 2 3 4 5 6{ "message": "This V2 API has been deprecated and disabled for your account. Please migrate to V3 Marketplace APIs.", "error": "API_DEPRECATED", "statusCode": 410, "migrationGuide": "https://developer.atlassian.com/platform/marketplace/changelog/#CHANGE-3257" }
The app resource within the /rest/2/addons API lets you query app details, including every field that is visible in a Marketplace app listing or that can be set through Manage Listings.
For an example of a script that uses this (using the Bash shell and curl), see get-addons.sh in the Marketplace API Tutorials repository.
You will need:
The URL for an app resource is currently https://marketplace.atlassian.com/rest/2/addons/ADDON_KEY - substituting your app key for ADDON_KEY.
However, rather than hard-coding the URL path for the resource, you can also obtain it by starting from the entry point of the API. This takes additional steps, but is a better practice in case resource paths ever change in the future.
Do a GET request to https://marketplace.atlassian.com/rest/2 — you will receive a JSON response that looks something like this:
1 2 3 4 5 6 7 8 9 10 11 12{ "_links": { "self": { "href": "/rest/2" }, [some more links...] "addons": { "href": "/rest/2/addons" } } }
The href property under addons is the URL path of the resource for finding apps. Do a GET request to this resource, with ?limit=0 added to indicate that you don't actually want a full list of apps https://marketplace.atlassian.com/rest/2/addons?limit=0 — you will receive a JSON response like this:
1 2 3 4 5 6 7 8 9 10 11 12{ "_links": { "self": { "href": "/rest/2/addons" }, [...some more links that you can ignore...] "byKey": { "href": "/rest/2/addons/{addonKey}", "templated": true } } }
Take the href property under byKey, and substitute the app key of your existing app for {addonKey} (for instance, /rest/2/addons/my.excellent.app). This gives you the URL path of the app resource.
You may optionally add any of the same query parameters that are supported by a query for multiple apps, except for offset and limit which are not applicable to a single app. The usual reason for doing this would be to get the current version of the app (?withVersion=true) or to get the latest version that meets some criteria (?withVersion=true&cost=free&hosting=server).
GETHere's a sample curl request to get the details for my.excellent.app, along with the current version:
1 2$ curl "https://marketplace.atlassian.com/rest/2/addons/my.excellent.app?withVersion=true"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29{ "_links": { "self": { "href": "/rest/2/addons/my.excellent.app" }, "alternate": { "href": "/plugins/my.excellent.app" } }, "_embedded": { "logo": { "_links": { "image": "https://marketplace-cdn.atlassian.com/files/my.excellent.app/icons/default/e1692eef-eda8-4508-909a.png" } }, "version": { "_links": { "href": "/rest/2/addons/my.excellent.app/build/100" }, "buildNumber": "100", "name": "1.0.0", [...other version properties...] } }, "key": "my.excellent.app", "name": "My Excellent App", [...other app properties...] }
/_links/alternate: A web link for viewing the app details on the Marketplace site./_embedded/logo/_links/image: An image URL for the app's logo. Note that there is also a /_links/logo link, which you will not normally use./_embedded/version: Information about the current (or latest matching) version of the app, if you specified withVersion=true.There are many other app version properties and resource links; for details, see the REST API documentation.
Rate this page: