logo
enes

Response

Last update: 7 days ago by Irais Aguirre

The response returned by the service is a JSON string that varies according to the response type.

Successful response example

{
"mappings": [
{
"name": " Google Short URL",
"originalURL": "http://google.com",
"shortURL": "http://bcm.com/2g3L",
"shortenedPrev": false
},
{
"name": "1-201905311532397",
"originalURL": "https://mail.google.com",
"shortURL": "http://bcm.com/2g3M",
"shortenedPrev": true
}
]
}

NameDescription
mappingsArray containing the result for each requested URL
nameName assigned to the URL; if none was provided, it is generated automatically.
originalURLOriginal URL.
shortURLShortened URL.
shortenedPrevFlag indicating whether the URL was shortened for the first time or had already been requested.

Error response example

When there is a problem processing the request, the JSON string changes; the string you will receive is shown below.

{
"error": {
"code": "ERROR_INVALID_PARAMETER",
"message": "Bad arguments",
"status": 400
}
}

NameDescription
codeResult code; its value indicates the type of error that occurred.
messageDescribes the type of error that occurred.
statusIdentifies the error that occurred with a numeric value.
shortURL — Previous
HTTP connection
Next
Error codes