{"_id":"56f32a7d4a8dae0e009ab423","editedParams2":true,"__v":4,"category":{"_id":"56d9d4287222d50b0070160b","__v":1,"pages":["56d9d483aa96cc150020eb35"],"version":"568af725176a6c0d00a29ec7","project":"568af724176a6c0d00a29ec4","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-03-04T18:30:00.578Z","from_sync":false,"order":2,"slug":"monetized-urls","title":"Monetized URLs"},"user":"568af6d197d8960d0012ab7d","version":{"_id":"568af725176a6c0d00a29ec7","project":"568af724176a6c0d00a29ec4","__v":11,"createdAt":"2016-01-04T22:50:13.289Z","releaseDate":"2016-01-04T22:50:13.289Z","categories":["568af725176a6c0d00a29ec8","56d9d397337fd11300d6a3e3","56d9d4287222d50b0070160b","56f424307ea0091700f63ac5","56f45babcb0dce29005a8e85","5739e5836c5ba134007a197d","57717aee3dd24019004c9122","5771b5d8c755ca0e00617d7d","579639964913990e001a5911","57e57e7df3d7fc0e009c5119","587569b6f4483a0f00d2e6b8"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"editedParams":true,"parentDoc":null,"project":"568af724176a6c0d00a29ec4","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-03-23T23:45:01.647Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"require 'httparty'\n\nparams = {\n  format: \"txt\",\n  key: \"88ac2a40e081e283ac504d1789d398ac\",\n  out: \"http://www.amazon.com/gp/product/B00KLDB866\",\n  loc: \"http://www.gopromocodes.com/store/Amazon.html\",\n  ref: \"http://othersite.com\"\n}\n\nurl = \"http://api.viglink.com/api/click\"\n\nresponse = HTTParty.get(url, query: params)","language":"ruby"}]},"method":"get","results":{"codes":[{"name":"","status":200,"language":"json","code":"\"http://www.amazon.com/gp/product/B00KLDB866?tag=vig-20\""}]},"settings":"56f32a60a0de870e003b6e34","auth":"required","params":[{"_id":"56f32acd4a8dae0e009ab427","ref":"","in":"query","required":false,"desc":"This must be set to value of \"txt\"  *Required","default":"none","type":"string","name":"format"},{"_id":"56f32acd4a8dae0e009ab426","ref":"","in":"query","required":false,"desc":"Your VigLink API key, found on your account page  *Required","default":"none","type":"string","name":"key"},{"_id":"56f32bd82ca4bd0e0055d111","ref":"","in":"query","required":false,"desc":"The URL to the document containing the link being monetized. URL must be properly encoded.  *Required","default":"none","type":"string","name":"loc"},{"_id":"56f32bd82ca4bd0e0055d110","ref":"","in":"query","required":false,"desc":"The URL to monetize. URL must be properly encoded.  *Required","default":"none","type":"string","name":"out"},{"_id":"56f32bd82ca4bd0e0055d10f","ref":"","in":"query","required":false,"desc":"An ID of your choosing that identifies the clicker, the page the link is on, a campaign or the click itself. See our CUID documentation for details. **32 alphanumeric character limit.","default":"none","type":"string","name":"cuid"},{"_id":"56f32bd82ca4bd0e0055d10e","ref":"","in":"query","required":false,"desc":"By default, VigLink will not modify URLs which are already affiliated. To force re-affiliation for a single URL, set reaf to true. If you’d like to force re-affiliation globally, you can make that change in your VigLink settings.","default":"false","type":"boolean","name":"reaf"},{"_id":"56f32bd82ca4bd0e0055d10d","ref":"","in":"query","required":false,"desc":"short for “referrer”, ref is the URL of the referring document for the current page. Expanding on the example from loc, if the user came from http://othersite.com to get to http://example.com, ref is http://othersite.com. URL must be properly encoded.","default":"none","type":"string","name":"ref"},{"_id":"56f32bd82ca4bd0e0055d10c","ref":"","in":"query","required":false,"desc":"The HTML title of the page containing the link to out","default":"none","type":"string","name":"title"},{"_id":"56f32bd82ca4bd0e0055d10b","ref":"","in":"query","required":false,"desc":"The HTML link text of the link to out","default":"none","type":"string","name":"txt"}],"url":"/click"},"isReference":false,"order":0,"body":"##**Documentation**\nAll Viglink Link Monetization API requests start with \"http://api.viglink.com/api/click\"\n\n##**Rate Limit**\nThere is no rate limit at the moment.\n\n##**Authorization**\nThere is no additional authorization needed besides including your API key as a query parameter. When logged into your dashboard, go to manage >> [account](https://publishers.viglink.com/account). Under the My Campaigns sub-heading, copy the API Key: \n\n##  **Sample call:**\n\n**Command Line**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -D - 'http://api.viglink.com/api/click?out=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB00KLDB866&ref=http%3A%2F%2Fothersite.com&loc=http%3A%2F%2Fwww.gopromocodes.com%2Fstore%2FAmazon.html&key=88ac2a40e081e283ac504d1789d398ac&format=txt'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n**Ruby (Using HTTParty Gem)**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"require 'httparty'\\n\\nparams = {\\n  format: \\\"txt\\\",\\n  key: \\\"88ac2a40e081e283ac504d1789d398ac\\\",\\n  out: \\\"http://www.amazon.com/gp/product/B00KLDB866\\\",\\n  loc: \\\"http://www.gopromocodes.com/store/Amazon.html\\\",\\n  ref: \\\"http://othersite.com\\\"\\n}\\n\\nurl = \\\"http://api.viglink.com/api/click\\\"\\n\\nresponse = HTTParty.get(url, query: params)\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\n##  **Sample Response:**\n\nThe response will be a single string that is your monetized url. For example:\nhttp://www.amazon.com/gp/product/B00KLDB866?tag=vig-20","excerpt":"The VigLink Link Monetization API allows you to monetize links directly with our simple HTTP API.","slug":"link-monetization-api","type":"endpoint","title":"Link Monetization API"}

getLink Monetization API

The VigLink Link Monetization API allows you to monetize links directly with our simple HTTP API.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

format:
stringnone
This must be set to value of "txt" *Required
key:
stringnone
Your VigLink API key, found on your account page *Required
loc:
stringnone
The URL to the document containing the link being monetized. URL must be properly encoded. *Required
out:
stringnone
The URL to monetize. URL must be properly encoded. *Required
cuid:
stringnone
An ID of your choosing that identifies the clicker, the page the link is on, a campaign or the click itself. See our CUID documentation for details. **32 alphanumeric character limit.
reaf:
booleanfalse
By default, VigLink will not modify URLs which are already affiliated. To force re-affiliation for a single URL, set reaf to true. If you’d like to force re-affiliation globally, you can make that change in your VigLink settings.
ref:
stringnone
short for “referrer”, ref is the URL of the referring document for the current page. Expanding on the example from loc, if the user came from http://othersite.com to get to http://example.com, ref is http://othersite.com. URL must be properly encoded.
title:
stringnone
The HTML title of the page containing the link to out
txt:
stringnone
The HTML link text of the link to out

Examples


Result Format


Documentation

##**Documentation** All Viglink Link Monetization API requests start with "http://api.viglink.com/api/click" ##**Rate Limit** There is no rate limit at the moment. ##**Authorization** There is no additional authorization needed besides including your API key as a query parameter. When logged into your dashboard, go to manage >> [account](https://publishers.viglink.com/account). Under the My Campaigns sub-heading, copy the API Key: ## **Sample call:** **Command Line** [block:code] { "codes": [ { "code": "curl -D - 'http://api.viglink.com/api/click?out=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2FB00KLDB866&ref=http%3A%2F%2Fothersite.com&loc=http%3A%2F%2Fwww.gopromocodes.com%2Fstore%2FAmazon.html&key=88ac2a40e081e283ac504d1789d398ac&format=txt'", "language": "curl" } ] } [/block] **Ruby (Using HTTParty Gem)** [block:code] { "codes": [ { "code": "require 'httparty'\n\nparams = {\n format: \"txt\",\n key: \"88ac2a40e081e283ac504d1789d398ac\",\n out: \"http://www.amazon.com/gp/product/B00KLDB866\",\n loc: \"http://www.gopromocodes.com/store/Amazon.html\",\n ref: \"http://othersite.com\"\n}\n\nurl = \"http://api.viglink.com/api/click\"\n\nresponse = HTTParty.get(url, query: params)", "language": "ruby" } ] } [/block] ## **Sample Response:** The response will be a single string that is your monetized url. For example: http://www.amazon.com/gp/product/B00KLDB866?tag=vig-20

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}