Version 3 of the BL.INK API (3.0.0)

Download OpenAPI specification:Download

API Support: help@bl.ink URL: https://help.bl.ink

Introduction

This is version 3 of the BL.INK API. It follows common REST patterns.

API PRIMARY BASE URL

https://app.bl.ink

Note: Enterprise customers must use the admin panel domain in place of https://app.bl.ink. Please use SSL (https) for all requests.

Authentication

All endpoints require a valid access token for authentication:

  1. Invoke the POST /access_token endpoint to get a new access_token
  2. Add the following header to all endpoint requests: Authorization: Bearer <access_token> If you see a refresh token in your BL.INK UI, use that to get a new access_token

There 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..

Client

To generate client SDK code:

  1. Download the OpenApi specification file (above)
  2. Follow these instructions: Swagger Code Generation

Validate Login

Validate Customer Login Credentials

Validates login information

Validates login information

Request Body schema: application/json
email
required
string <email>
password
required
string <password>

Responses

200

Successfully validated that the username and password are correct

401

The input auth data was invalid

post /validate_login
https://app.bl.ink/api/v3/validate_login

Request samples

application/json
Copy
Expand all Collapse all
{
  • "email": "bud@smartlinker.email",
  • "password": "pa$$word"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "success": 1,
  • "user":
    {
    }
}

Access Token

Create Access Token

Returns a valid authentication token

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.

Request Body schema: application/json
One of
  • CredentialsEmailPassword
  • CredentialsEmailRefreshToken
email
required
string <email>
password
required
string <password>

Responses

200

A valid token should have been returned

401

The input auth data was invalid

post /access_token
https://app.bl.ink/api/v3/access_token

Request samples

application/json
Copy
Expand all Collapse all
{
  • "email": "bud@smartlinker.email",
  • "password": "pa$$word"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "success": 1,
  • "user":
    {
    },
  • "access_token": "8Am4WSbKTBvZtDRq48f7",
  • "expires": 1918085162
}

List Domains

List Domains

Returns a list of the user's active domains

Returns a list of the user's active domains

Responses

200

Successfully returned a list of active domains.

type field

When set to shared-readonly it denotes that the domain is a smart link domain

get /domains
https://app.bl.ink/api/v3/domains

Response samples

application/json
Copy
Expand all Collapse all
{
  • "objects":
    [
    ]
}

Will take the passed in URL and create a new shortened link.

Will take the passed in URL and create a new shortened link based on the parameters that are passed in.

path Parameters
domain_id
required
integer
Request Body schema: application/json
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.

tags
Array of object

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

Responses

200

Successfully created the short link using passed in parameters

400

The input data was invalid

post /{domain_id}/links
https://app.bl.ink/api/v3/{domain_id}/links

Request samples

application/json
Copy
Expand all Collapse all
{
  • "url": "string",
  • "alias": "string",
  • "dupe_check": 0,
  • "tags":
    [
    ],
  • "utm_template_id": 0,
  • "utm_fields":
    {
    },
  • "archive_on": 0,
  • "delete_on": 0,
  • "redirect_type": 301
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "objects":
    [
    ]
}

Will take the passed in URL and validate it.

Will take the passed in URL and validate it.

Request Body schema: application/json
url
required
string

URL encoded URL. It's a URL

Responses

200

The URL is valid

400

The input data was invalid

post /links/validate
https://app.bl.ink/api/v3/links/validate

Request samples

application/json
Copy
Expand all Collapse all
{
  • "url": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "objects":
    [
    ]
}

Returns a list of user's links filtering by query params

Searches for all links matching the query parameters that belong to the API user

path Parameters
domain_id
required
integer
query Parameters
keyword
string

Search link alias, notes, and long 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

Responses

200

Successfully return a list of links

400

The input data was invalid

get /{domain_id}/links
https://app.bl.ink/api/v3/{domain_id}/links

Response samples

application/json
Copy
Expand all Collapse all
{
  • "total": 0,
  • "count": 0,
  • "click_count": 0,
  • "objects":
    [
    ]
}

List UTM Templates

List UTM Templates

Returns a list of available UTM templates

Returns a list of available UTM templates

query Parameters
domain_id
required