Product Placement API - mychannel-is/mychannel-docs GitHub Wiki
Welcome to the MYC Product Placement API v1.
This API allows request and tracking of product placements in video files.
All API calls require a mc_api_key
. This can be provided anywhere in the
query string, body, or in the header: X-MC-API-Key
.
The API is also fully CORS compliant.
This API gives data on all videos, products, and placements available. It can be used when dynamic request of placements is not appropriate.
GET https://api-cdn.myc-dev.com/public/1/public_channel/<public_channel_id>
public_channel_id - number - The channel ID.
The API responds with the following depending on the result.
Events have been successfully processed.
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2
Date: Sun, 10 Nov 2013 04:24:17 GMT
<json>
See examples for response contents.
If the channel is not found a 404 error will be returned. If the server has an internal error, a 500 will be returned.
Calls to the API are made with a POST to the API endpoint.
GET /client/1/product_placement
channel_video_id - number - Channel video ID.
user_id - string - Identifier for the user. Used for trottling and targeting.
start_time - number - Start time in seconds where the placement should be valid. The first valid non-throttled placement that ends after the start time will be returned.
The API responds with the following depending on the result.
A placement has been found and can be shown to the user.
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2
Date: Sun, 10 Nov 2099 04:24:17 GMT
{
"product": {
"is_reserve_only": false,
"options": {
"sizes": [
"42",
"43",
"44",
"45",
"46",
"47"
]
},
"price": 299.99,
"product_description": "Color Graphite",
"product_id": 6,
"product_image_url": "https://media1.cdn.myc-dev.com/0ec4343fab14017ce9f948d1b74694c7",
"product_name": "Thick Suede Desert Boot",
"product_order": 0,
"tracker_icon_url": false
},
"product_placement": {
"channel_video_id": 75,
"end_time": 9999,
"height": 100,
"product_id": 6,
"product_placement_id": 14,
"start_time": 100,
"width": 100,
"x": 0,
"y": 0
}
}
width, height, x and y are all in percentages.
start_time and end_time are in seconds.
No valid placement was found, or the user displays have been throttled so that there are no valid placements.
HTTP/1.1 404 Not Found
Content-Type: text/plain
Content-Length: 2
Date: Sun, 10 Nov 2099 04:24:17 GMT
Not Found
Calls to the API are made with a POST to the API endpoint.
POST /client/1/product_placement/show_track
product_placement_id - number - Placement that was clicked
user_id - string - Identifier for the user. Used for trottling and targeting.
device_id - string - (optional) The device identifier
The API responds with the following depending on the result.
Tracking was successful
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 2
Date: Sun, 10 Nov 2099 04:24:17 GMT
OK
Calls to the API are made with a POST to the API endpoint.
POST /client/1/product_placement/click_track
product_placement_id - number - Placement that was clicked
user_id - string - Identifier for the user. Used for trottling and targeting.
device_id - string - (optional) The device identifier
The API responds with the following depending on the result.
Tracking was successful
HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 2
Date: Sun, 10 Nov 2099 04:24:17 GMT
OK