Skip to main content

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

ParameterRequiredValue
AuthenticationYType: Bearer
Token: JWT Token
AcceptYapplication/json
Content-TypeYapplication/json; charset=UTF-8

Request Body Schema: application/json

ParameterRequiredDescription/Values
remote_urlYDestination URL to shorten i.e., mask behind a Short URL
nameOptionalName for the Short URL
descriptionOptionalShort description for the Short URL
valid_until_dateOptionalValid 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.

ParameterDescription
result_codeRefer Result Code List
result_messageDescription of the result code
masked_url_idThe masked URL ID post shortening of the Remote URL
public_masked_urlThe 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>"
}