Introduction

Learn how to use UrlHum Rest APIs

UrlHum has very basic REST API at the moment.
The authentication is made via Bearer Token that identifies the user.

Users can create their own access tokens going in their profile section using the menu: /profile/access-token

Access Tokens don't expire. Users can see last used time, add new access tokens (giving them a name) and remove them.

When creating an access token, users will be provided with the plain token that will be visible just that time. Reloading or closing the page will result in the token lost and the user will need to create it again.

The only endpoint currently available is for creating a short url.

Making requests

Every request must include the following headers:

Content-Type: application/json
Accept: application/json
Authentication: Bearer {token}

Replace token with your own token obtained previously.

Obviously the body of the request must be a valid JSON.

Every endpoint is actually prefixed with /api/v1/

Handling errors

UrlHum responses vary based on the error generated.

Status codeError typeReason
404Endpoint not foundUsing a non-existing endpoint
404URL not foundShort URL in request doesn't exist
403ForbiddenUser Token is not allowed to perform this action
409Parameters or generic error about the URLYou may have passed an invalid parameter. Read message response key to know the reason
500Unhandled exceptionServer error. Check the error logs.
401UnauthenticatedToken is invalid.