Knowledge Base/VigLink API

JavaScript API CUID Reporting

hannah
posted this on November 09, 2011 03:31 pm

The recommended VigLink installation snippet includes our JavaScript library on your page. Once included, the library handles affiliation of external links automatically. Want a little more control? Tweak the options or use its JavaScript API (more information available here: http://support.viglink.com/entries/20646001-api-documentation).

If you chose to include a cuid on click requests, we provide a reporting API to get information on the number and destination of clicks with a cuid associated with them.

URL

https://www.viglink.com/service/v1/outboundClicks

Required Parameters

cuid

Alphanumeric String, maximum length 32 characters (corresponds to the cuid provided to the API at click-time).

secret

Secret key provided by VigLink, found on under your account.  This is used for authentication.

period

'day' = 1 day of data, 'week' = results in 7 days of data, 'month' = 30 days of data

lastDate

The last date for which data should be returned, should be in the format YYYY/MM/DD

Response

JSON object containing the single key ʻrowsʼ, whose value is an array of JSON objects. Each object in that array contains the following:

clicks

Integer Number

domain

String

HTTP Response Codes

200: OK

400: Missing or bad parameters

403: Attempt to access service over HTTP or bad secret key

503: Service unavailable

 

Example

BigBlogPlatform.com uses cuids to track clicks.  They are particularly interested in cuid 200 and would like to know how many clicks and to what domain that cuid had.

BigBlogPlatform first logs into their account and located their secret key: 62f60fb1ee5972097a21f205bfe707b3c9888c97.  They decide they want monthly data ending on 10/31/2011, so they type the following URL into a web browser:

https://www.viglink.com/service/v1/outboundClicks?cuid=200&secret=62f60fb1ee5972097a21f205bfe707b3c9888c97&period=month&lastDate=2011/11/08


The response is:

{
    "rows": [
        {
            "clicks": 3,
            "domain": "amazon.com"
        },
        {
            "clicks": 1,
            "domain": "barnesandnoble.com"
        }
    ]
}

 
Topic is closed for comments