URL shortening
Definition
This api endpoint is used to shorten url, for later use in BulkGate Portal.
API URL
URL used to send HTTP requests:
https://portal.bulkgate.com/api/1.0/shortener/shorten
POST /api/1.0/shortener/shorten HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json
Cache-Control: no-cache
API has
20
request per minute limit.
Parameters table
PARAMETER NAME | VALUE | MANDATORY | DEFAULT VALUE |
---|---|---|---|
application_id | Application ID | Yes | - |
application_token | Application token | Yes | - |
target_url | Url to be shortened | Yes | - |
url_type | Domain of url to be shortened (ur7.fr , u1.pm , ms6.fr , ms6.cz , msg.bg ) | No | u1.pm |
Example of full request:
POST /api/1.0/shortener/shorten HTTP/1.1
Host: portal.bulkgate.com
Content-Type: application/json
Cache-Control: no-cache
{
"application_id": "APPLICATION_ID",
"application_token": "APPLICATION_TOKEN",
"target_url": "www.bulkgate.com",
"url_type": "u1.pm"
}
Response to this command may be:
In case of success:
{
"data": {
"short_url": "http://u1.pm/W",
"target_url": "http://bulkgate.com",
"final_url": "https://www.bulkgate.com/en/",
"title": "SMS & other channels for business communication | BulkGate"
}
}
In case of error:
{
"type": "url_is_not_valid",
"code": 400,
"error": "Url is not valid",
"detail": null
}
{
"type": "url_type_is_incorrect",
"code": 400,
"error": "Url type is incorrect",
"detail": null
}
{
"type": "the_per_minute_quota_has_been_exceeded",
"code": 400,
"error": "The per minute quota has been exceeded",
"detail": null
}
{
"type": "url_is_unavailable",
"code": 400,
"error": "Url is unavailable",
"detail": null
}