Content Update API
- Last updated
- Save as PDF
ContentUpdate API documentation version v1
https://{environment}.richrelevance.com/contentupdate
The content update service provides an API for providing content update instructions.
- environment: required (one of gateway, qa-gateway)
Access Token Uri
post /oauth2/token
Body
Media type: application/x-www-form-urlencoded
Type: object
Properties- grant_type: required (string)
The access token type: client_credentials
Example:
client_credentials
- client_id: required (string)
Client's id.
Example:
asRjkljasf12348flkaj
- client_secret: required (string)
Client's secret. Keep this secure.
Example:
fkjkjigu24q5lkjaksfj
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- token_type: required (string)
The type of the authentication token: "bearer"
Example:
bearer
- access_token: required (string)
Generated token, keep this secure. Good for a limited time.
Example:
AABBCCDD
- expires_in: required (integer)
Number of seconds the token is good for.
Example:
7200
Example:
{
"token_type": "bearer",
"access_token": "AABBCCDD",
"expires_in": 7200
}
HTTP status code 400
Body
Media type: application/json
Type: object
Properties- error_description: required (string)
- error: required (string)
Examples:
first:
{
"error_description": "Invalid client authentication",
"error": "invalid_client"
}
second:
{
"error_description": "Invalid grant_type",
"error": "unsupported_grant_type"
}
Content Resource
Put a collection of new content into the content catalog or fully replace content with the matching id in the content catalog.
Update a property or properties of a collection of content. Properties not included will be unchanged.
put /{version}/{apiKey}
Put a collection of new content into the content catalog or fully replace content with the matching id in the content catalog.
URI Parameters
- version: required (v1)
Version of this API.
- apiKey: required (string)
The apiKey of the site.
Example:
abcdef1234
Body
Media type: application/json
Type: array of Content
Items: Content
- id: required (string - maxLength: 100)
Must be a unique ID. NOTE: Forward slashes (/) are not supported in the ContentID field.
- name: (string - default: "" - maxLength: 255)
The name of the content as it will be displayed in recommendations on site and in the RichRelevance Dashboard. If missing, name is not updated if the content is already in the system.
- tags: (array of string)
List of strings that describe the piece of content A tag can be no longer than 100 characters long. If it is, we will truncate all characters after the 100th character. While there's no theoretical limit to how many tags a piece of content have, we recommend no more than 20 tags per content.
- rating: (number - default: -1)
The rating for this content (specified by client). Usually this is generated by collecting the average of customer ratings/reviews.
- start_date: (date-only)
When this content is available to be displayed. If not specified, it's available to be displayed any time. Format: yyyy-mm-dd. Defaults to today.
- end_date: (date-only)
When does this content expire? Once expired we should not display it any longer. If not specified, it is available to be displayed indefinitely. Format: yyyy-mm-dd.
- {content attribute}: (array of string)
Content attributes is where you will specify the variables needed to render a content. Things like image urls and landing page urls have to be passed in as attributes. We expect each piece of content to have a minimum of 1 attribute that allows us to render that piece of content back to the consumer. If a piece of content doesn't have any attributes then it will not be stored in our system.
Example:
[{
"id": "123",
"name": "Fall Fashion",
"tags": ["fall", "fashion", "sale"],
"rating": "4.0",
"start_date": 2016-08-28,
"end_date": 2016-11-28,
"image_url": ["http://my.cdn.com/path/to/my/image/123.jpg"],
"click_thru": ["http://my.domain.com/path/to/my/content/landing/page/123.html"],
"size": ["100"]
},
{
"id": "124",
"name": "Free Shipping",
"tags": ["shipping", "checkout"],
"rating": "3.5",
"start_date": 2016-07-28,
"image_url": ["http://my.cdn.com/path/to/my/image/123.jpg"],
"click_thru": ["http://my.domain.com/path/to/my/content/landing/page/123.html"],
"color": ["blue"]
}]
HTTP status code 202
Body
Media type: application/json
Type: object
Properties- trackingId: required (string)
A tracking id that can be used to check status of the submitted catalog update.
Example:
{
"trackingId": "YOUR_TRACKING_ID"
}
Secured by oauth2_0
patch /{version}/{apiKey}
Update a property or properties of a collection of content. Properties not included will be unchanged.
URI Parameters
- version: required (v1)
Version of this API.
- apiKey: required (string)
The apiKey of the site.
Example:
abcdef1234
Body
Media type: application/json
Type: array of Content
Items: Content
- id: required (string - maxLength: 100)
Must be a unique ID. NOTE: Forward slashes (/) are not supported in the ContentID field.
- name: (string - default: "" - maxLength: 255)
The name of the content as it will be displayed in recommendations on site and in the RichRelevance Dashboard. If missing, name is not updated if the content is already in the system.
- tags: (array of string)
List of strings that describe the piece of content A tag can be no longer than 100 characters long. If it is, we will truncate all characters after the 100th character. While there's no theoretical limit to how many tags a piece of content have, we recommend no more than 20 tags per content.
- rating: (number - default: -1)
The rating for this content (specified by client). Usually this is generated by collecting the average of customer ratings/reviews.
- start_date: (date-only)
When this content is available to be displayed. If not specified, it's available to be displayed any time. Format: yyyy-mm-dd. Defaults to today.
- end_date: (date-only)
When does this content expire? Once expired we should not display it any longer. If not specified, it is available to be displayed indefinitely. Format: yyyy-mm-dd.
- {content attribute}: (array of string)
Content attributes is where you will specify the variables needed to render a content. Things like image urls and landing page urls have to be passed in as attributes. We expect each piece of content to have a minimum of 1 attribute that allows us to render that piece of content back to the consumer. If a piece of content doesn't have any attributes then it will not be stored in our system.
Example:
[{
"id": "123",
"tags": ["fall", "fashion", "sale", "limited"]
},
{
"id": "124",
"rating": 3.4,
"click_thru": ["http://my.domain.com/path/to/my/content/landing/page/123_v2.html"]
}]
HTTP status code 202
Body
Media type: application/json
Type: object
Properties- trackingId: required (string)
A tracking id that can be used to check status of the submitted catalog update.
Example:
{
"trackingId": "YOUR_TRACKING_ID"
}