Skip to content

Instantly share code, notes, and snippets.

@chadwilcomb
Last active August 29, 2015 14:23
Show Gist options
  • Save chadwilcomb/e8aaf814368492f5849a to your computer and use it in GitHub Desktop.
Save chadwilcomb/e8aaf814368492f5849a to your computer and use it in GitHub Desktop.
CIP 2.0 API Docs

Dashboards

List your dashboards

List dashboards for the authenticated user.

GET /user/dashboards

Parameters

Name Type Description
sort string Can be one of created, updated, created. Default: full_name
direction string Can be one of asc or desc. Default: when using full_name: asc; otherwise desc

List user dashboards

List public dashboards for the specified user.

GET /users/:username/dashboards

Parameters

Name Type Description
type string Can be one of all, owner, member. Default: owner
sort string Can be one of created, updated, pushed, full_name. Default: full_name
direction string Can be one of asc or desc. Default: when using full_name: asc, otherwise desc

List organization dashboards

List dashboards for the specified org.

GET /orgs/:org/dashboards

Parameters

Name Type Description
type string Can be one of all, public, private, forks, sources, member. Default: all

Response

Status: 200 OK
Link: <https://api.cip.placieq.com/user/dashboards?page=3&per_page=20>; rel="next",
  <https://api.cip.placeiq.com/user/dashboards?page=50&per_page=20>; rel="last"
[
    {
        "campaign_id": 238973650,
        "name": 'Pepsi_Dorito_SoF',
        "full_name": 'Pepsi Dorito Summer of Fun',
        "start_date": '1/3/15',
        "end_date": '4/31/15',
        "line_items": [
            {
                "campaign_id": 238973650,
                "line_item_id": 70684330,
                "line_item_name": 'Hispanic Grandmothers that watch weTV',
                "impressions": 1875312,
                "conversions": 1705,
                "pvr": 0.00404165,
                "pvr_lift": 4.5894875,
                "cpm": 8.0,
                "ctr": 0.00254568,
                "ab_lift": 1.0457205648,
                "selected": false,
                "analytics": [
                    {
                        "line_item_id": 70684330,
                        "category": 'Automotive',
                        "subcategory": 'In Market',
                        "attribute": 'New',
                        "type": 'exposed',
                        "index": 93,
                        "stat_sig": 'high',
                        "sort_order": 1
                    },
                ],
                "impressions": [
                    {
                        "line_item_id": 70684330,
                        "lat": 40.7562,
                        "lng": -73.9887,
                        "precision": 0.0001,
                        "type": 'conversion'
                    },
                ],
                "creatives": [
                    {
                        "line_item_id": 70684330,
                        "url": '//pagead2.googlesyndication.com/pagead/imgad?id=CICAgKDT8OftgQEQARgBMggheEYekqNBFQ',
                        "ctr": 0.00233102598485,
                        "impressions": 689825
                    },
                ]
            }
        ]
    }
]

Fetch Analytics

Get the analytics from the Dashboard AJAX calls

GET /analytics/:line_item_id

Parameters

Name Type Description
category string Filter by category
subcategory string Filter by subcategory
group string Can be one of category, subcategory, attribute. Will group results based on one of these columns. Default is category
sort string Can be one of index, sort_order, category, subcategory, attribute. Default is sort_order.
direction string Can be one of asc or desc. Default: when using index: desc; otherwise asc.

Response

[
    {
        "line_item_id": 70684330,
        "category": 'Automotive',
        "subcategory": 'In Market',
        "attribute": 'New',
        "type": 'exposed',
        "index": 93,
        "stat_sig": 'high',
        "sort_order": 1
    },
    {
        "line_item_id": 70684330,
        "category": 'Automotive',
        "subcategory": 'In Market',
        "attribute": 'New',
        "type": 'converted',
        "index": 107,
        "stat_sig": 'high',
        "sort_order": 1
    },
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment