Link Generation API

Getting Started

Welcome to the Prourls API! If you’re looking to create Prourls links programmatically, you’ve come to the right place.

Authentication

API Key

API Keys allow you to generate an authentication credential that is separate from your username and password. They are independent from one another and are easily disposable. To use the Prourls link generation API, you must register with Proruls and get a Prourls API key which you can add to your application.

Example

$curl –request POST \
–url https://api2.prourls.com/v1/url/create \
–header ‘authorization: Bearer YOUR_API_KEY’ \
–data ‘{“redirect”:{ “US” : “http://www.your-amazon-product/search-url.com”, “GB” : “your keyword” }}’

PHP Example:

$url = “https://api2.prourls.com/v1/url/create”;
$rules = array(“US” => “https://www.amazon.com/Yuneec-Typhoon-Intel-RealSense-Technology/dp/B01HHVLDQO/”, “GB” => “Hexacopter Drone”);
$data = array(
“redirect” => $rules
);
$json = json_encode($data);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(“Content-length:”.strlen($json)));
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);

JSON format:

{
“redirect” : {
“ALL”: “Amazon Kindle”
“US” : “http://www.amazon.com”,
“GB” : “Amazon Echo”
},
}

‘redirect’ variable – Amazon product page/ search page to which visitors will be redirected.

In the above example all visitors except from US and UK  will be redirected to Amazon Kindle search page. US visitors will be redirected to http://www.amazon.com and UK visitors will be redirected to https://www.amazon.co.uk/s/?field-keywords=Amazon%20Echo

Parameters supported by ‘redirect’ variable

All – For adding URL/ Keywords for all countries. For the country specific redirect URL/
Keywords use the following parameters with the redirect variable:
US – United States
GB – United Kingdom
IN – India
DE – Germany
FR – France
IT – Italy
ES – Spain
NL – Netherlands
BR – Brazil
CA – Canada
MX – Mexico
CN – China
JP – Japan
AU – Australia

The API currently gives response in JSON format.

If your request was successful, you will get response in following format:

{ “status_code”: 200, “status_msg”: “OK”, “data” :”{“short_url” : “https://prourls.co/123”, “id” : “123”}”}

You will get response in the following format if any of the parameters are missing or not being passed:

{ “status_code”: 400, “status_msg”: “MISSING_API_KEY”, “data” : null }
{ “status_code”: 400, “status_msg”: “MISSING_PARAMETERS/ RULES”, “data” : null }
{ “status_code”: 403, “status_msg”: “RATE_LIMIT_EXCEEDED”, “data” : null }
{ “status_code”: 500, “status_msg”: “UNKNOWN_ERROR”, “data” : null }
{ “status_code”: 503, “status_msg”: “TEMPORARILY_UNAVAILABLE”, “data” : null }

Rate Limiting

Prourls institutes per-month, per-hour, per-minute, per-user, and per-IP rate limits for each API method. Currently our Amazing plan customers can make upto 500 requests per month and enterprise customers can make upto 10,000 requests per month.

Please note that some API rate limit resets once every hour. If you are experiencing rate limiting errors, please wait 60 minutes to resume making API calls.

High-volume users

If you’re a high-volume user of the Proruls API, please contact us at [email protected] to discuss your options.

When contacting Prourls support include a description of how you are using the Prourls API, which API endpoints you are using, an estimate of current request volumes for a 24 hour period, and the email associated with your Proruls account.

This entry was posted in   API.
Bookmark the   permalink.

Paul has written 13 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">