Download OpenAPI specification:Download
This is version 3 of the BL.INK API. It follows common REST patterns.
API PRIMARY BASE URL
Note: Enterprise customers must use the admin panel domain in place of https://app.bl.ink. Please use SSL (https) for all requests. All API calls are subject to a rate limit of 5 connections per second per IP address. All requests exceeding that limitation will receive a HTTP 503 (Service Temporarily Unavailable).
All endpoints require a valid access token for authentication:
POST /access_token
endpoint to get a new access_tokenAuthorization: Bearer <access_token>
If you see a refresh token in your BL.INK UI, use that to get a new access_tokenThere are two types of tokens, access and refresh token. An access token is used with each api call to verify the user. A user requests an access token with either their username and password, or their username and their refresh token. An access token expires after 24 hours. Our api end point to retrieve an access token will always return a valid access token so the user doesn't need to keep track of expiration.
If you would rather not supply your password to receive an access token, you may use the refresh token instead..
To generate client SDK code:
Validates login information
email required | string <email> |
password required | string <password> |
Successfully validated that the username and password are correct
The input auth data was invalid
{- "email": "bud@smartlinker.email",
- "password": "pa$$word"
}
{- "success": 1,
- "user": {
- "user_id": 2,
- "nickname": "Bud",
- "email": "bud@smartlinker.email"
}
}
Returns a valid authentication token. When requesting a token it will return an existing not-expired token. If an existing expired token exists, it will generate a new token and return that. This will accept either a password for the account or a refresh token.
email required | string <email> |
password required | string <password> |
A valid token should have been returned
The input auth data was invalid
{- "email": "bud@smartlinker.email",
- "password": "pa$$word"
}
{- "success": 1,
- "user": {
- "user_id": 2,
- "nickname": "Bud",
- "email": "bud@smartlinker.email"
}, - "access_token": "8Am4WSbKTBvZtDRq48f7",
- "expires": 1918085162
}
Returns a list of the user's active domains
Successfully returned a list of active domains.
type
fieldWhen set to shared-readonly
it denotes that the domain is a smart link domain
{- "objects": [
- {
- "id": 0,
- "domain": "string",
- "created": 0,
- "modified": 0,
- "default": true,
- "type": "string"
}
]
}
Returns a short link. Each short link has a corresponding domain it belongs to and and individual id.
domain_id required | integer |
link_id required | integer |
Successfully returned a short link.
{- "objects": [
- {
- "id": 0,
- "url": "string",
- "alias": "string",
- "short_link": "string",
- "redirect_url": "string",
- "created": 0,
- "modified": 0,
- "user_id": 0,
- "domain_id": 0,
- "click_count": 0,
- "notes": "string",
- "redirect_type": 0,
- "status": "string",
- "template_id": 0,
- "delete_on": 0,
- "archive_on": 0
}
]
}
Will take the passed in URL and create a new shortened link based on the parameters that are passed in.
domain_id required | integer |
url required | string The long link. The URL protocol is optional. |
alias | string Short string that will be used at the end of the domain to build your short link. Alias |
dupe_check | integer A flag that when set to 1 will return check if a link if found first and returns the link if found or creates and returns a new link. |
notes | string Notes to attach onto the link. |
tags | Array of objects Array of objects defining tags to be attached to the link |
utm_template_id | integer |
utm_fields | object Object defining key-value pairs for builder fields |
archive_on | integer GMT Unix timestamp defining the date to archive the link |
delete_on | integer GMT Unix timestamp defining the date to delete the link |
redirect_type | integer Enum: 301 307 |
Successfully created the short link using passed in parameters
The input data was invalid
{- "url": "string",
- "alias": "string",
- "dupe_check": 0,
- "notes": "string",
- "tags": [
- {
- "name": "string",
- "shared": true
}
], - "utm_template_id": 0,
- "utm_fields": {
- "field_1": "value1",
- "field_2": "value2",
- "field_3": "value c"
}, - "archive_on": 0,
- "delete_on": 0,
- "redirect_type": 301
}
{- "objects": {
- "id": 0,
- "url": "string",
- "alias": "string",
- "short_link": "string",
- "redirect_url": "string",
- "created": 0,
- "modified": 0,
- "user_id": 0,
- "domain_id": 0,
- "click_count": 0,
- "notes": "string",
- "redirect_type": 0,
- "status": "string",
- "template_id": 0,
- "delete_on": 0,
- "archive_on": 0
}
}
Will take an array of objects defining operations to be performed. This is based on the JSON patch format as defined in RFC 6902.
domain_id required | integer |
link_id required | integer |
op | string Default: "replace" Value: "replace" |
path | string Enum: "/alias" "/notes" "/url" "/delete_on" "/archive_on" The path property accepts string values for all paths. However, for the archive on and delete on paths an unix timestamp integer value can be accepted as an integer or string. A note on delete_on and archive_on; One can specify a reserved syntax corresponding to a number followed by the letter d. For example '1d' or '-1d' to easily allow for altering the delete_on and archive_on dates relative to the current time/day. |
value | string or integer |
Successfully modified the link
The input data was invalid
[- {
- "op": "replace",
- "path": "/alias",
- "value": "string"
}
]
{- "objects": [
- {
- "id": 0,
- "url": "string",
- "alias": "string",
- "short_link": "string",
- "redirect_url": "string",
- "created": 0,
- "modified": 0,
- "user_id": 0,
- "domain_id": 0,
- "click_count": 0,
- "notes": "string",
- "redirect_type": 0,
- "status": "string",
- "template_id": 0,
- "delete_on": 0,
- "archive_on": 0
}
]
}
Will take the passed in URL and validate it.
url required | string URL encoded URL. It's a URL |
The URL is valid
The input data was invalid
{- "url": "string"
}
{- "objects": [
- {
- "url": "string"
}
]
}
Searches for all links matching the query parameters that belong to the API user
domain_id required | integer |
keyword | string Search link alias, notes, and redirect url for keyword |
page | integer Page number |
url | string long URL to search links by |
order | string Orders results differently. Possible values 'oldest' or 'latest'. Defaults to 'oldest' |
users | string A flag for privlidged users (domain admins or account admins) to specify returning all links from corresponding domain instead of just links they created. Example users=all |
Successfully return a list of links
The input data was invalid
{- "total": 0,
- "count": 0,
- "click_count": 0,
- "objects": [
- {
- "id": 0,
- "url": "string",
- "alias": "string",
- "short_link": "string",
- "redirect_url": "stri