{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/click","auth":"required","examples":{"codes":[{"language":"ruby","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)"}]},"method":"get","params":[{"name":"format","type":"string","default":"none","desc":"This must be set to value of \"txt\"  *Required","required":false,"in":"query","ref":"","_id":"56f32acd4a8dae0e009ab427"},{"name":"key","type":"string","default":"none","desc":"Your VigLink API key, found on your account page  *Required","required":false,"in":"query","ref":"","_id":"56f32acd4a8dae0e009ab426"},{"name":"loc","type":"string","default":"none","desc":"The URL to the document containing the link being monetized. URL must be properly encoded.  *Required","required":false,"in":"query","ref":"","_id":"56f32bd82ca4bd0e0055d111"},{"name":"out","type":"string","default":"none","desc":"The URL to monetize. URL must be properly encoded.  *Required","required":false,"in":"query","ref":"","_id":"56f32bd82ca4bd0e0055d110"},{"name":"cuid","type":"string","default":"none","desc":"An ID of your choosing that identifies the clicker, the page the link is on, a campaign or the click itself. **32 alphanumeric character limit.","required":false,"in":"query","ref":"","_id":"56f32bd82ca4bd0e0055d10f"},{"name":"reaf","type":"boolean","default":"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.","required":false,"in":"query","ref":"","_id":"56f32bd82ca4bd0e0055d10e"},{"name":"ref","type":"string","default":"none","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.","required":false,"in":"query","ref":"","_id":"56f32bd82ca4bd0e0055d10d"},{"name":"title","type":"string","default":"none","desc":"The HTML title of the page containing the link to out","required":false,"in":"query","ref":"","_id":"56f32bd82ca4bd0e0055d10c"},{"name":"txt","type":"string","default":"none","desc":"The HTML link text of the link to out","required":false,"in":"query","ref":"","_id":"56f32bd82ca4bd0e0055d10b"},{"name":"opt","type":"boolean","default":"false","desc":"By default, VigLink will not modify the destination url to help you earn more money. Enable this to send the visitor to the same product at a higher paying retailer.","required":false,"in":"query","ref":"","_id":"5b477fa15d47b70003c236be"}],"results":{"codes":[{"code":"\"http://www.amazon.com/gp/product/B00KLDB866?tag=vig-20\"","language":"json","status":200,"name":""}]},"settings":"56f32a60a0de870e003b6e34"},"next":{"description":"","pages":[]},"title":"Link Monetization API","type":"endpoint","slug":"link-monetization-api","excerpt":"The VigLink Link Monetization API allows you to monetize links directly with our simple HTTP API.","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","updates":["5b71bff8cb535e000376a582","5be4cc58f2a711038ea3a6e4"],"order":0,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"56f32a7d4a8dae0e009ab423","editedParams2":true,"githubsync":"","__v":8,"category":{"sync":{"isSync":false,"url":""},"pages":["56d9d483aa96cc150020eb35"],"title":"Monetized URLs","slug":"monetized-urls","order":2,"from_sync":false,"reference":false,"_id":"56d9d4287222d50b0070160b","__v":1,"version":"568af725176a6c0d00a29ec7","createdAt":"2016-03-04T18:30:00.578Z","project":"568af724176a6c0d00a29ec4"},"user":"568af6d197d8960d0012ab7d","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["568af725176a6c0d00a29ec8","56d9d397337fd11300d6a3e3","56d9d4287222d50b0070160b","56f424307ea0091700f63ac5","56f45babcb0dce29005a8e85","5739e5836c5ba134007a197d","57717aee3dd24019004c9122","5771b5d8c755ca0e00617d7d","579639964913990e001a5911","57e57e7df3d7fc0e009c5119","587569b6f4483a0f00d2e6b8","5ca3c2274439e800149daf96"],"_id":"568af725176a6c0d00a29ec7","project":"568af724176a6c0d00a29ec4","releaseDate":"2016-01-04T22:50:13.289Z","__v":12,"createdAt":"2016-01-04T22:50:13.289Z"},"createdAt":"2016-03-23T23:45:01.647Z","editedParams":true,"parentDoc":null,"project":"568af724176a6c0d00a29ec4"}

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. **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
opt:
booleanfalse
By default, VigLink will not modify the destination url to help you earn more money. Enable this to send the visitor to the same product at a higher paying retailer.

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 }}