shorturl
    • PDF

    shorturl

    • PDF

    Article summary

    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:

    MethodURI
    GET/POST/shorturl

    Request headers

    For headers common to all nShortURL APIs, see Common nShortURL headers.

    Request query parameters

    The following describes the parameters.

    FieldTypeRequiredDescription
    urlStringRequiredOriginal 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.

    FieldTypeRequiredDescription
    resultObject-Shortened URL details
    result.urlString-Shortened URL address
    • Output in me2.do format
    result.hashString-Shortened URL hash information
    result.orgURLString-Source URL
    timestampString-Shortening failure date and time (yyyy-MM-ddTHH:MM:SSZ)
    statusInteger-HTTP status code
    errorString-HTTP status type
    messageString-URL shortening error message
    codeString-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?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.