Create a new redirect

POST /api
application/json

Body Required

  • redirect string Required
  • shortcode string
  • expire number

    The number of minutes before the shortcode expires. Default is 0, which means never expires.

    Minimum value is 0, maximum value is 525600.

Responses

  • 201 application/json

    Created - Resource successfully created

    Hide response attributes Show response attributes object
    • shortcode string Required
    • redirect string Required
    • status string Required
  • 400 application/json

    Bad Request

    Hide response attribute Show response attribute object
    • status string Required

      Values are shortcode_too_long or invalid_expire_time.

  • 401 application/json

    Unauthorized

    Hide response attribute Show response attribute object
    • status string Required

      Value is unauthorized. Default value is unauthorized.

  • 403 application/json

    Forbidden

    Hide response attribute Show response attribute object
    • status string Required

      Shortcode is blocked

      Value is shortcode_blocked. Default value is shortcode_blocked.

  • 409 application/json

    Shortcode already exists

    Hide response attribute Show response attribute object
    • status string Required

      Value is shortcode_already_exists. Default value is shortcode_already_exists.

POST /api
curl \
 --request POST 'https://s.jqshuv.com/api' \
 --header "Authorization with Header: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"redirect":"string","shortcode":"string","expire":42.0}'
Request examples
{
  "redirect": "string",
  "shortcode": "string",
  "expire": 42.0
}
Response examples (201)
{
  "shortcode": "string",
  "redirect": "string",
  "status": "string"
}
Response examples (400)
{
  "status": "shortcode_too_long"
}
Response examples (401)
{
  "status": "unauthorized"
}
Response examples (403)
{
  "status": "shortcode_blocked"
}
Response examples (409)
{
  "status": "shortcode_already_exists"
}