Create Short URL
Description
To shorten a URL, it is necessary to make a POST request to the SHORT URL API endpoint.
Note: If a Short URL is created for a "remote_url", then subsequent requests to create a new Short URL for the same "remote_url" will result in the same "masked_url_id" being provided in the response
Production Endpoint URL: https://api.cpaas.symphony.rakuten.net/short-url/v1/url/
Methods: POST
HTTP Headers
Parameter | Required | Value |
---|---|---|
Authentication | Y | Type: Bearer Token: JWT Token |
Accept | Y | application/json |
Content-Type | Y | application/json; charset=UTF-8 |
Request Body Schema: application/json
Parameter | Required | Description/Values |
---|---|---|
remote_url | Y | Destination URL to shorten i.e., mask behind a Short URL |
name | Optional | Name for the Short URL |
description | Optional | Short description for the Short URL |
valid_until_date | Optional | Valid until date in the format "yyyy-MM-dd HH:mm:ss" e.g.., "2024-06-15 13:21:45" Default: 3 days Minimum: 5 mins Maximum: 30 days |
Sample Request
{
"masked_url": {
"remote_url": "...Destination URL to mask behind a Short URL...",
"name": "updated name"
"description": "updated description"
"valid_until_date": "yyyy-MM-dd HH:mm:ss"
}
}
Response:
If successful, the API call will return an HTTP 200 OK with a JSON document as a response. Please see section "Error Codes" for a description of the failure responses.
Parameter | Description |
---|---|
result_code | Refer Result Code List |
result_message | Description of the result code |
masked_url_id | The masked URL ID post shortening of the Remote URL |
public_masked_url | The final Public URL including the masked URL ID |
Sample Response
{
"result_code": 0,
"result_message": "Success",
"masked_url_id": "...Generated Masked URL ID...",
"public_masked_url": "https://<api.hostname>/<masked_url_id>"
}