shorturl
- Print
- PDF
shorturl
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Available in Classic and VPC
Convert a long, complex URL to a short URL of the me2.do
format.
Request
The following describes the request format for the endpoint. The request format is as follows:
Method | URI |
---|---|
GET/POST | /shorturl |
Request headers
For headers common to all nShortURL APIs, see Common nShortURL headers.
Request query parameters
The following describes the parameters.
Field | Type | Required | Description |
---|---|---|---|
url | String | Required | Original URL before shortening to me2.do format |
Request example
The following is a sample request.
- GET
curl --location --request GET 'https://naveropenapi.apigw.ntruss.com/util/v1/shorturl
?url={url} \
--header 'X-NCP-APIGW-API-KEY-ID: {Client ID issued when registering the app}' \
--header 'X-NCP-APIGW-API-KEY: {Client secret issued when registering the app}'
- POST -
Content-Type: application/x-www-form-urlencoded
method
curl --location --request POST 'https://naveropenapi.apigw.ntruss.com/util/v1/shorturl' \
--header 'X-NCP-APIGW-API-KEY-ID: {Client ID issued when registering the app}' \
--header 'X-NCP-APIGW-API-KEY: {Client secret issued when registering the app}' \
--header 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
--data-urlencode 'url={url}'
- POST -
Content-Type: application/json
method
curl --location --request POST 'https://naveropenapi.apigw.ntruss.com/util/v1/shorturl' \
--header 'X-NCP-APIGW-API-KEY-ID: {Client ID issued when registering the app}' \
--header 'X-NCP-APIGW-API-KEY: {Client secret issued when registering the app}' \
--header 'Content-Type: application/json' \
--data '{
"url": "{url}"
}'
Response
The following describes the response format.
Response body
The following describes the response body.
Field | Type | Required | Description |
---|---|---|---|
result | Object | - | Shortened URL details |
result.url | String | - | Shortened URL address
|
result.hash | String | - | Shortened URL hash information |
result.orgURL | String | - | Source URL |
timestamp | String | - | Shortening failure date and time (yyyy-MM-ddTHH:MM:SSZ) |
status | Integer | - | HTTP status code |
error | String | - | HTTP status type |
message | String | - | URL shortening error message |
code | String | - | Response code |
Response status codes
For response status codes common to all nShortURL APIs, see Common nShortURL response status codes.
Response example
The following is a sample example.
- When URL shortening is successful
{
"result": {
"url": "https://me2.do/Ffe****",
"hash": "Ffe0DVRP",
"orgUrl": "{orgURL}"
},
"message": "ok",
"code": "200"
}
- When URL shortening fails
{
"timestamp": "2024-08-19T00:26:00Z",
"status": 403,
"error": "FORBIDDEN",
"message": "UNAVAILABLE_URL",
"code": "3403"
}
Was this article helpful?