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.

API Endpoint

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.

Video Overview API

This API gives data on all videos, products, and placements available. It can be used when dynamic request of placements is not appropriate.

Request

GET https://api-cdn.myc-dev.com/public/1/public_channel/<public_channel_id>

public_channel_id - number - The channel ID.

Response

The API responds with the following depending on the result.

Success

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.

Failure

If the channel is not found a 404 error will be returned. If the server has an internal error, a 500 will be returned.

Request Placement While Playing

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.

Response

The API responds with the following depending on the result.

Success

Placement found

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.

Placement not found

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

Track placement shown

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

Response

The API responds with the following depending on the result.

Success

Track Success

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

Track placement clicked

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

Response

The API responds with the following depending on the result.

Success

Track Success

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
⚠️ **GitHub.com Fallback** ⚠️