- Content and Member requests
- Responses
- Examples
- Error codes
- Downloading licensed files
- More information
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/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. This is covered in the next section, License history reference.
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.
See Headers for Stock API calls for details about header content.
- Required headers:
x-Product
,x-api-key
,Authorization
- Optional headers:
X-Request-Id
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 only 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
|
Calls return information in JSON structures.
- 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)
}
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: content_id |
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. |
GET /Rest/Libraries/1/Content/Info?content_id=59741022 HTTP/1.1
Host: stock.adobe.io
X-Product: MySampleApp/1.0
x-api-key: MyApiKey
Authorization: Bearer MyAccessToken
{
"contents": {
"59741022": {
"content_id": 59741022,
"purchase_details": {
"member_id": 23456,
"state": "not_purchased"
},
"size": "Comp"
}
},
"member": {
"member_id": 23456
}
}
GET /Rest/Libraries/1/Content/Info?content_id=62047262&license=Extended HTTP/1.1
Host: stock.adobe.io
X-Product: MySampleApp/1.0
x-api-key: MyApiKey
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
}
}
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.
GET /Rest/Libraries/1/Content/License?content_id=62305369&license=Standard HTTP/1.1
Host: stock.adobe.io
X-Product: MySampleApp/1.0
x-api-key: MyApiKey
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
}
}
}
}
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
.
POST /Rest/Libraries/1/Content/License?content_id=88744241&license=Standard HTTP/1.1
Host: stock.adobe.io
Content-Type: application/json
X-Product: MySampleApp/1.0
x-api-key: MyApiKey
Authorization: Bearer MyAccessToken
{
"cce_agency": [
{ "id": "3", "value": "AcmePillows" },
{ "id": "4", "value": "123456789" }
]
}
JSON response is identical to response for a normal GET Content/License request.
GET /Rest/Libraries/1/Member/Profile?content_id=112670342&license=Standard HTTP/1.1
Host: stock.adobe.io
X-Product: MySampleApp/1.0
x-api-key: MyApiKey
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."
}
}
GET /Rest/Libraries/1/Member/Profile?content_id=64285595&license=Standard HTTP/1.1
Host: stock.adobe.io
X-Product: MySampleApp/1.0
x-api-key: MyApiKey
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
}
}
GET /Rest/Libraries/1/Member/Profile?locale=en_US&content_id=64285595 HTTP/1.1
Host: stock.adobe.io
X-Product: MySampleApp/1.0
x-api-key: MyApiKey
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"
}
}
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.
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 |
---|---|
https://stock.adobe.io/Rest/Libraries/Download/{id}/1 | GET |
In the URL above, the {id}
value must be substituted with the Adobe Stock ID attribute.
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.
None (see above).
Parameter | Description |
token | Valid access token. String. Required, used in place of the 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:
* Only applies to video. |
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.
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"
- "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 expired
- "Cannot 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.
- See Licensing Stock assets.
- For guides to licensing assets for the enterprise or individual users, see the Workflow guides.