<!-- omit in toc -->
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.
<!-- MarkdownTOC--> <!--
-
-
More information --> <!-- /MarkdownTOC -->
Content and Member requests
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.
id attribute. Integer."" (empty string): No license applies<br>- For standard/core photos, illustrations, and vectors (non-Premium):<br> - Standard: License for the full-resolution image<br> - Extended: Extended license for the full-resolution image<br>- For video:<br> - Video_HD: License for the HD-resolution video<br> - Video_4K: License for the 4K-resolution video. Tip: Not all videos are available in 4K.<br>- For vector assets: Standard or Extended<br>- For 3D assets: Standard<br>- For templates: Standard<br>- For Premium:<br> - Standard: License for the full-resolution image<br> - Standard_M: License for a medium-size asset approximately 1600x1200 pixels. Tip: Not all Premium assets offer this license.<br> - Extended: Extended license for the full-resolution image<br>- Additional license values if Alternative Licenses are available:<br> - Internal_Use<br> - Video_HD_Internal_Use<br> - Digital_Use<br> - Video_HD_Digital_Use<br> - Social_Media<br> - Video_HD_Social_Media<br> - Video_HD_Standarden_US. See the full list of Locales.false, meaning that if Content/License is used on an asset that is already licensed, it will not trigger a new license. Using true overrides that behavior, and forces a new license event.<br><br>curl "https://stock.adobe.io/Rest/Libraries/1/Content/License?content_id=112670342&license=Standard&license_again=true" -H "x-api-key: YourApiKeyHere" -H "x-product: MySampleApp/1.0" -H "authorization: Bearer AccessTokenHere"Responses
Calls return information in JSON structures.
Response JSON summaries
- Content/Info returns this structure. Some attributes appear only in certain situations.
{
"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.
{
"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.
{
"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_licensesif Alternative Licenses are enabled on the account.
{
"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
available_entitlement{...}available_entitlement.quota value instead. Array.contents{...}content_id: "contents": { "12345": { "content_id": 12345, ... }, ... }not_purchased (User has not at any time in the past purchased the asset), purchased (User has at some time in the past purchased the asset), cancelled (User attempted to buy the asset and for some reason the order did not go through), not_possible (User must go to the Adobe Stock site to buy plan or asset), just_purchased (User bought asset within the current session), overage (Adobe Stock has a payment instrument on file for the user and can bill the user for additional purchases; does not apply to enterprise as it is always possible to add additional licenses).Comp, Original.contents.purchase_details.state above. String.locale command). String.locale command). String.Examples
Content/Info
Asset not purchased by this user
curl --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'
{
"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
curl --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'
{
"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.
curl --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'
{
"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.
curl --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
curl --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'
{
"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
curl --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'
{
"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
curl --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'
{
"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
errorkey. -
Optionally, a
codekey. 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.
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
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.5000 (5000px or original size image), 3100 (3100-4999px image), 2400 (2400-3099px image), 1600 (1600-2399px image), 800 (800-1599px image), 400 (799px or smaller image), 2160 (Full/original 4K video), 1080 (HD 1080 video).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
curl -L "https://stock.adobe.com/Rest/Libraries/Download/62305369/1?token=MyAccessToken" > "AdobeStock_62305369.jpeg"
Download of 1600px image
curl -L "https://stock.adobe.com/Rest/Libraries/Download/62305369/1?token=MyAccessToken&size=1600" > "AdobeStock_62305369-1600.jpeg"
Download of 1080p rendition of video
curl -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.