Licensing reference
The Stock API provides the following methods related to licensing and getting more info about licensed assets. For a guide to usage and additional examples, see Licensing Stock assets.
Content and Member requests
Endpoints | Method |
---|---|
GET | |
GET, POST (for adding license references) | |
GET | |
GET |
Description of endpoints
- Content/Info. Requests licensing information about a specific asset for a specific user or enterprise organization.
- Content/License. Requests a license for an asset.
- Member/Profile. Asks for the licensing capabilities for a specific user or organization. Call this before requesting an asset license so that you can display the user's existing quota or direct the user to the Adobe Stock site to purchase a plan or asset. This API returns the user's available purchase quota and information that you can use to present licensing options to the user when the user next requests an asset purchase. Depending on the user's quota and plan the following cases can occur:
- User has enough quota to license the next asset. Display the returned message, which shows the user's current quota before purchasing.
- User doesn't have enough quota but can handle overage (they have a saved purchase method on file). Display the returned message, which includes the price and asks the user to license the asset with overage.
- User doesn't have quota and there is no overage plan. Display the returned message, which indicates that the user will be redirect to the Adobe Stock site to review plans.
- Member/LicenseHistory. Requests a list of licenses and download URLs for every previously licensed asset. This is covered in the next section, License history reference.
Authentication
The Authorization header is required for any of the licensing calls. The API uses the header to determine the user's member number, licensing status, and default locale. See API authentication for more information.
Request headers
See Headers for Stock API calls for details about header content.
- Required headers:
x-Product
,x-api-key
,Authorization
- Optional headers:
X-Request-Id
URL parameters
Pass URL-encoded parameters with the GET request.
Parameter | Description |
---|---|
content_id | Asset's unique identifier. You can get this from a search response's id attribute. Integer. |
license | Use with Content/Info, Content/License, and Member/Profile. The Adobe Stock licensing state for the asset. String. Valid values and meaning:
|
locale | Use with Member/Profile and Member/LicenseHistory. Optional. Location language code for the API to use when returning localized messages. The API can usually get the user's default locale through the Authorization header. This value overrides that or provides a locale if not available through Authorization. String. Default is |
license_again | Use with Content/License. Optional. Used to re-license an asset, deducting licenses/credits as if it were a new transaction. Boolean. Default is
|
Responses
Calls return information in JSON structures.
Response JSON summaries
- Content/Info returns this structure. Some attributes appear only in certain situations.
Copied to your clipboard{"contents": {"0000": {"content_id": 0000,"purchase_details": {"stock_id": 12345, /*only if user has not purchased*/"date": "yyyy-mm-dd hh:mm:mm", /*only if purchased*/"license": "...", /*only if purchased*/"state": "..."},"size": "..."}},"member": {"stock_id": 12345}}
- Content/License returns this structure. Some attributes appear only in certain situations.
Copied to your clipboard{"available_entitlement": {"quota": n,"license_type_id": x,"has_credit_model": true||false,"has_agency_model": true||false,"is_cce": true||false,"full_entitlement_quota": []},"contents": {"0000": {"content_id": 0000,"purchase_details": {"state": "...","license": "...","date": "yyyy-mm-dd hh:mm:mm", /*only if licensed*/"url": "...", /*only if download needed*/"content_type": "...","width": 000,"height": 000,/*additional props depending on asset type...*/},"size": "..."}},"member": {"member_id": 12345}}
- Member/Profile returns this structure. Some attributes appear only in certain situations.
Copied to your clipboard{"available_entitlement": {"quota": n,"license_type_id": x,"has_credit_model": true||false,"has_agency_model": true||false,"is_cce": true||false,"full_entitlement_quota": []},"purchase_options": {"state": "...","requires_checkout": ....,"message": "...","url": "..." /*only if user has no quota or overage*/},"member": {"member_id": 12345} /*only if user has quota or overage*/}
- Member/Profile can also return the attribute
possible_licenses
if Alternative Licenses are enabled on the account.
Copied to your clipboard{"available_entitlement": {"quota": 9733,"license_type_id": 43,"has_credit_model": false,"has_agency_model": true,"is_cce": true,"full_entitlement_quota": {"universal_credits_quota": 9733},"quota_ids": {"universal_credits_quota": "credits"},"user_has_ccpro": false,"organization_has_ccpro": false},"member": {"stock_id": 14357036},"purchase_options": {"state": "possible","requires_checkout": false,"license": "Extended","message": "This will use 2 of your 9,733 credits."},"possible_licenses": [{"license": "Social_Media","license_label": "Social Media","price_with_unit": "5 Credits"},{"license": "Extended","license_label": "Extended","price_with_unit": "2 Credits"}]}
Response attributes
Name | Description |
---|---|
available_entitlement{...} | Information about licenses available for this user. Structure. |
available_entitlement: quota | Quantity of licenses/credits remaining available for this user for this asset type. Integer. |
available_entitlement: license_type_id | License type of combined asset and license. Integer. |
available_entitlement: has_credit_model | (Enterprise only) Type of enterprise contract model. Boolean. |
available_entitlement: has_agency_model | (Enterprise only) Type of enterprise contract model. Boolean. |
available_entitlement: is_cce | Whether this is an enterprise entitlement or not. Boolean. |
available_entitlement: full_entitlement_quota | Licensing quota types available. This information is subject to change as new license types are added and subtracted; best practice is to use the main available_entitlement.quota value instead. Array. |
contents{...} | Licensing information for this asset for this user. Structure. The number directly inside contents is the same asset ID number that is returned in content_id :"contents": { "12345": { "content_id": 12345, ... }, ... } |
contents: | Asset's unique identifier. String. |
contents: purchase_details{...} | Information about the user's purchase/license of this asset. Structure. |
contents: purchase_details: state | User's purchase relationship to an asset. Possible values and meanings:
|
contents: purchase_details: license | Type of license that the user has for this asset. String. For possible values, see URL parameters, above. |
contents: purchase_details: date | Date when the asset was purchased or licensed. Date format. |
contents: purchase_details: url | The URL from which the licensed asset can be downloaded. String. |
contents: purchase_details: content_type | Mime type of asset. String. |
contents: purchase_details: width/height/... | Dimensions and other physical properties of asset. Mixed types. |
contents: size | The size of the asset, indicating whether it is the free complementary size or the original full-sized asset. String. Possible values:
|
purchase_options {...} | Information about the user's purchasing options for this asset. Structure. |
member {...} | Information about the user; for Adobe Stock internal use. |
purchase_options: requires_checkout | Whether a purchase in process requires going to the Adobe Stock site for completion. Returns true or false. Boolean. |
purchase_options: message | Message to display to your user in response to a Licensing API query. String. All returned messages are localized and generated for you by the Stock API. This provides uniform messaging for all clients of Stock API. |
purchase_options: state | User's purchase relationship to an asset. See contents.purchase_details.state above. String. |
purchase_options: url | Only displayed if user is not able to license asset. URL directs user to Adobe Stock site to get plan. String. |
possible_licenses {...} | This block is returned if Alternative Licenses are enabled for the account. Structure. |
possible_licenses: license | License field value. For possible values, see URL parameters, above. String. |
possible_licenses: license_label | Name of license to display to user (text localized by locale command). String. |
possible_licenses: price_with_unit | Cost in credits for user (text localized by locale command). String. |
Examples
Content/Info
Asset not purchased by this user
Copied to your clipboardcurl --location --request GET 'https://stock.adobe.io/Rest/Libraries/1/Content/Info?content_id=59741022&locale=en_US' --header 'X-Product: MySampleApp/1.0' --header 'x-api-key: MyApiKey' --header 'Authorization: Bearer MyAccessToken'
Copied to your clipboard{"contents": {"59741022": {"content_id": 59741022,"purchase_details": {"member_id": 23456,"state": "not_purchased"},"size": "Comp"}},"member": {"member_id": 23456}}
Asset purchased by this user with Extended license
Copied to your clipboardcurl --location --request GET 'https://stock.adobe.io/Rest/Libraries/1/Content/Info?content_id=62047262&license=Extended&locale=en_US' --header 'X-Product: MySampleApp/1.0' --header 'x-api-key: MyApiKey' --header 'Authorization: Bearer MyAccessToken'
Copied to your clipboard{"contents": {"62047262": {"content_id": 62047262,"purchase_details": {"date": "2015-02-10 15:00:00","license": "Extended","state": "purchased"},"size": "Original"}},"member": {"member_id": 23456}}
Content/License
Just-licensed asset with existing quota
Download from the purchase_details.url
and indicate how many purchasing options remain for the user. You can download the asset again without using any quota or making a purchase.
Copied to your clipboardcurl --location --request GET 'https://stock.adobe.io/Rest/Libraries/1/Content/License?content_id=62305369&license=Standard&locale=en_US' --header 'X-Product: MySampleApp/1.0' --header 'x-api-key: MyApiKey' --header 'Authorization: Bearer MyAccessToken'
Copied to your clipboard{"available_entitlement": {"quota": 48,"license_type_id": 42,"has_credit_model": false,"has_agency_model": true,"is_cce": true,"full_entitlement_quota": {"image_quota": 48}},"contents": {"62305369": {"content_id": "62305369","size": "Comp","purchase_details": {"state": "just_purchased","license": "Standard","date": "2017-11-01 22:57:48","url": "https://stock.adobe.com/Rest/Libraries/Download/62305369/1","content_type": "image/jpeg","width": 3333,"height": 2222}}}}
Using license references in license request
If your enterprise account is configured to require or allow optional license references, then the Content/License request must be made a POST, adding the references as JSON in the body of the message. Additionally, the Content-Type
of the request should be application/json
.
Copied to your clipboardcurl --location --request POST 'https://stock.adobe.io/Rest/Libraries/1/Content/License?content_id=172563501&license=Extended' --header 'X-Product: MySampleApp/1.0' --header 'x-api-key: MyApiKey' --header 'Authorization: Bearer MyAccessToken' --header 'Content-Type: text/plain' --data-raw '{"cce_agency": [{ "id": "2", "value": "Project Banana" },{ "id": "4", "value": "King Kong Co" }]}'
JSON response is identical to response for a normal GET Content/License request.
Member/Profile
User has quota
Copied to your clipboardcurl --location --request GET 'https://stock.adobe.io/Rest/Libraries/1/Member/Profile?content_id=112670342&license=Standard&locale=en_US' --header 'X-Product: MySampleApp/1.0' --header 'x-api-key: MyApiKey' --header 'Authorization: Bearer MyAccessToken'
Copied to your clipboard{"available_entitlement": {"quota": 48,"license_type_id": 1,"has_credit_model": false,"has_agency_model": false,"is_cce": false,"full_entitlement_quota": {"image_quota": 48}},"member": {"stock_id": 1272100},"purchase_options": {"state": "possible","requires_checkout": false,"message": "This will use 1 of your 48 licenses."}}
User has no quota but has an overage plan
Copied to your clipboardcurl --location --request GET 'https://stock.adobe.io/Rest/Libraries/1/Member/Profile?content_id=64285595&license=Standard&locale=en_US' --header 'X-Product: MySampleApp/1.0' --header 'x-api-key: MyApiKey' --header 'Authorization: Bearer MyAccessToken'
Copied to your clipboard{"available_entitlement": {"quota": 0,"license_type_id": 1,"has_credit_model": false,"has_agency_model": false,"is_cce": false,"full_entitlement_quota": {"image_quota": 0}},"purchase_options": {"state": "overage","requires_checkout": false,"message": "Would you like to license the image for $2.99?"},"member": {"member_id": 34567}}
User has no quota or overage plan
Copied to your clipboardcurl --location --request GET 'https://stock.adobe.io/Rest/Libraries/1/Member/Profile?content_id=64285595&locale=en_US' --header 'X-Product: MySampleApp/1.0' --header 'x-api-key: MyApiKey' --header 'Authorization: Bearer MyAccessToken'
Copied to your clipboard{"available_entitlement": {"quota": 0,"full_entitlement_quota": {"image_quota": 0}},"purchase_options": {"state": "not_possible","requires_checkout": true,"message": "Would you like to see purchase options?","url": "http://stock.adobe.io/plans?image_id=64285595"}}
Error codes
Each error generates a JSON array that contains the following keys and values. If your application receives this array and you need assistance, send the array to Adobe.
- An
error
key. - Optionally, a
code
key. Specifies an integer designating the category of error. Code values:10
: Invalid access token. The access token that you passed is invalid or expired.11
: Invalid API Key. The API key that you passed is not valid or has expired.20
: Invalid parameters. The URL parameters that you passed are not supported.31
: Invalid Method. The method that you specified does not exist in the method list.100
: Invalid data. Data that you specified as arguments are not supported.
Downloading licensed files
The Content/License method returns a download URL, which uses the Libraries/Download endpoint. This URL can be accessed via a normal GET request over an HTTPS connection.
Endpoint | Method |
---|---|
GET |
In the URL above, the {id}
value must be substituted with the Adobe Stock ID attribute, while {license}
is an integer returned by Adobe Stock in the download URL. Because this integer value can change without notice, it is recommended not to predict this value, but to get it by calling the Content/License
method to first obtain the download URL.
Authentication
Unlike other Stock API license methods, Download does not use request headers for authentication; using an authentication header can break the download URL. Instead, the access token needs to be sent via a URL parameter--see below.
Request headers
None (see above).
URL parameters
Parameter | Description |
---|---|
token | Valid access token. String. Required, used in place of the Authorization: Bearer {token} authentication header. The token does not need to be the same one used to license the asset as long as it is from the same user or enterprise entitlement. |
size | Optional, requested image size. Integer. Only valid for bitmap/image assets and videos only (e.g., does not apply to template, vector, or 3D assets.) If command is not present, file returned will be full/original size. Valid values:
|
Response
A valid response will trigger a file download, otherwise, an error will be returned. Downloads will typically consist of a 302 redirect which points to a signed URL, but some downloads are served directly without a redirect.
Examples
In the following examples, "MyAccessToken" would be substituted with a valid access token generated by your application. When using curl, be sure to include the "follow redirects" option (-L
on the command line.)
Download of original asset
Copied to your clipboardcurl -L "https://stock.adobe.com/Rest/Libraries/Download/62305369/1?token=MyAccessToken" > "AdobeStock_62305369.jpeg"
Download of 1600px image
Copied to your clipboardcurl -L "https://stock.adobe.com/Rest/Libraries/Download/62305369/1?token=MyAccessToken&size=1600" > "AdobeStock_62305369-1600.jpeg"
Download of 1080p rendition of video
Copied to your clipboardcurl -L "https://stock.adobe.com/Rest/Libraries/Download/99872034/1?token=MyAccessToken&size=1080" > "AdobeStock_99872034-1080.mp4"
Download errors
This download cannot be processed, invalid size
: Size command must be one of the values listed above, and file must be an image or video asset.This download is expired
: Token has expiredCannot find a download for this file and license on this organization
: Invalid access token, or generated for wrong user/account, or asset is not actually licensed. Use Content/Info or Member/Profile for more information.
More information
- See Licensing Stock assets.
- For guides to licensing assets for the enterprise or individual users, see the Workflow guides.