Developer Center

Building Monetized URLs

Creating one-off monetized URLs is easy using VigLink Anywhere. Paste any URL and get a portable VigLink URL which monetizes the original whenever possible.

It's sometimes useful to create VigLink Anywhere URLs programmatically. The URL format and behavior are documented below.

Request

URL
http://redirect.viglink.com
Method
GET
Parameters
key
Your VigLink API key, found on your account page.

required; string

key=88ac2a40e081e283ac504d1789d398ac
u

The URL to monetize.

required; string; format: URL

u=http%3A%2F%2Famazon.com%2Fdp%2F0316769487

Note: VigLink Anywhere wraps the link monetization API. If any of those parameters are included, they'll be passed through to the underlying API. One case where that's especially useful is advanced revenue tracking—just pass your cuid like normal.

Response

The server will respond with one of these HTTP status codes:

302

The request was successful. The client should be redirected.

If the input URL (specified by the u parameter) could be monetized, the client is redirected to the monetized version of that URL. If there is no monetized version, the client is redirected to the original URL, unmodified.

400
Required parameters are missing, or their values are not valid.
403

The specified URL is unsafe.

To protect users from malicious web sites, URLs are checked against a list of "bad" sites before redirecting. If the URL is found to be unsafe, a warning page is displayed. For more information visit stopbadware.org.

Example

You'd like to share a monetized version of this URL: http://amazon.com/dp/0316769487

After building the monetized link, it should look something like this: http://redirect.viglink.com?u=http%3A%2F%2Famazon.com%2Fdp%2F0316769487&key=88ac2a40e081e283ac504d1789d398ac

When someone follows the VigLink URL, they'll be redirected to the monetized version of your original URL:

$ curl -D - 'http://redirect.viglink.com?u=http%3A%2F%2Famazon.com%2Fdp%2F0316769487&key=88ac2a40e081e283ac504d1789d398ac'
        
HTTP/1.1 302 Moved Temporarily
Content-Length: 0
Location: http://amazon.com/dp/0316769487?tag=vig-20