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.

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>

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://{instance}.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.

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://{instance}.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://{instance}.bl.ink/api/v3/domains

Response samples

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

Get Link

Returns a short link

Returns a short link. Each short link has a corresponding domain it belongs to and and individual id.

path Parameters
domain_id
required
integer
link_id
required
integer

Responses

200

Successfully returned a short link.

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

Response samples

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

Create Link

Create Branded Link or Smart Link

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

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://{instance}.bl.ink/api/v3/{domain_id}/links

Request samples

application/json
Copy
Expand all Collapse all
{
  • "url": "string",
  • "alias": "string",
  • "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":
    [
    ]
}

Update Link

Update Link

Takes a series of change operations and applies them to the link

Will take an array of objects defining operations to be performed. This is based on the JSON patch format as defined in RFC 6902.

Supported Operations:

  • replace

Supported paths:

  • /alias
  • /url
  • /notes
path Parameters
domain_id
required
integer
link_id
required
integer
Request Body schema: application/json
Array
op
string
Default: "replace"
Enum:"replace"
path
string
Enum:"/alias" "/notes" "/url"
value
string

Responses

200

Successfully modified the link

400

The input data was invalid

patch /{domain_id}/links/{link_id}
https://{instance}.bl.ink/api/v3/{domain_id}/links/{link_id}

Request samples

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

Response samples

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

Validate Link

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://{instance}.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":
    [
    ]
}

List Links

List Links

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'

Responses

200

Successfully return a list of links

400

The input data was invalid

get /{domain_id}/links