Please Wait...
You can call "Bulk URL(s) Short" API to programmatically create thousands of shorten URLs for longer URLs by calling a single API request. You can use your own branded domain or SPRL default domain and also you can set the expiry date for the campaign.
Method | POST |
---|---|
Request URL | https://insprl.com/api/url/bulk-short-url |
Authentication | Required How to Generate API keys? |
Parameter | Type | Description |
---|---|---|
Authorization | String | Use your "CLIENT KEY" for this Parameter |
Parameter | Type | Validate | Description |
---|---|---|---|
client_id | String | Required | Use your "CLIENT ID" for this Parameter |
urls | Array | Required | Add multiple urls (Up to 1000) which you want to get shorter. |
slug_prefix | String | Optional | Allowed only alpha-numeric characters, underscores, and dashes. |
domain | String | Optional | Specify if you want to use custom domain |
expiry_date | Date | Optional | Date format: dd-mm-yyyy |
response_mode | String | Optional | "plain" (Default) or "along" (Pass the reference key to receive in response) |
Parameter | Type | Description |
---|---|---|
code | Numeric | Find the code information below under "API Codes" |
message | String / Array | As per the request handler |
short_urls | Array | List of Shorten URLs |
Code | Mode | Type | Description |
---|---|---|---|
100 | success | String | On Success |
101 | failed | String | Authorization Error |
102 | failed | Array | Parameter Validation Error |
echo <<$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://insprl.com/api/url/bulk-short-url");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: {CLIENT_KEY}'
));
curl_setopt($ch, CURLOPT_POSTFIELDS,
http_build_query(
array(
'client_id' => '{CLIENT_ID}',
'urls' => ["https://www.google.com","https://www.sunprograms.com"],
//'urls' => {"A1":"https://www.google.com","A2":"https://www.sunprograms.com"}, /*Response Mode: "along" */
'slug_prefix' => 'b1-',
'domain' => 'mydomain.com',
'expiry_date' => '11-02-2020'
'response_mode' => 'plain'
)
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close ($ch);
With "response_mode" : "plain"
{
"code": 100,
"message": "success",
"data": {
"short_urls": ["https://mydomain.com/sUJIrI","https://mydomain.com/hg6IrI"],
}
}
With "response_mode" : "along"
{
"code": 100,
"message": "success",
"data": {
"short_urls": {"A1": "https://mydomain.com/sUJIrI","A2": "https://mydomain.com/hg6IrI"},
}
}
If you'd like to use our REST API into your application, Feel free to contact us.
8088 948 172 or Contact Us
Read our latest posts from our blog
If you are into marketing, you must have heard of Bulk URL shortening. They are saying Bulk URL shortening is the new ..
Every profit driven business enterprise is adopting and incorporating URL Shortening as a part of best business ..
If your company or business isn’t using email promoting, ought to they? The solution is affirmative, as email is ..
This website uses cookies in order to offer you the most relevant information. We may place cookies on your computer for functional, marketing and tracking purposes to improve our site and to show personalised content. You can read more about our cookies here: Cookie Policy. Please accept cookies for optimal performance.
Yes, I accept Cookies.