NAV

Introduction

Welcome to the Zalink API! You can use our API to access Zalink API endpoints, which can create users, authenticate users, create applications, and generate shortened links.

Zalink API URLs follow the format https://zal.ink/api/[resource].

Users /user

User Sample Request:

{
  "name": "John Doe",
  "email": "johndoe@email.com",
  "password": "NewPassword!"
}

User Sample Response:

{
  "user_id": "6064d38b-b5b9-41e5-8902-84a4aea3a27d",
  "name": "John Doe",
  "email": "johndoe@email.com"
}

Create a Zalink user account.

Required Authentication: None

HTTP Request

POST https://zal.ink/api/user

Query Parameters

Parameter Required Description
name false The name on the account
email true The email address on the account
password true The password for the account - must be at least 8 characters long

Tokens /token

User Sample Request:

{
  "email": "johndoe@email.com",
  "password": "NewPassword!"
}

User Sample Response:

{
  "token": "A8RVi858bmcVoVhN"
}

Authenticate a user to receive a User Token. User Tokens are valid for 60 minutes.

Required Authentication: None

HTTP Request

POST https://zal.ink/api/token

Query Parameters

Parameter Required Description
email true Email address for authentication
password true Password for authentication

Applications /application

User Sample Request:

{
  "name": "John's Application"
}

User Sample Response:

{
  "application_id": "6bf4a09b-f02f-40b0-8672-d83c147ad219",
  "application_name": "John's Application",
  "app_key": "my6gcWbwwRBC7cp9"
}

Create a new application. Returns an Application Id and Key which are required to create a link. Application Keys never expire.

Required Authentication: Token

HTTP Request

POST https://zal.ink/api/application

Headers

Header Required Description
token true Authorization token

Query Parameters

Parameter Required Description
name true The name of your new application.

Links /link

User Sample Request:

{
  "url": "https://www.google.com/"
}

User Sample Response:

{
  "link_id": "3382c855-892a-40c9-a607-dbad887db9bb",
  "short_url": "https://zal.ink/S7ej4Aq",
  "url": "https://www.google.com/"
}

Create a new link to receive a shortened URL.

Required Authentication: Application Id/Key

HTTP Request

POST https://zal.ink/api/link

Headers

Header Required Description
application_id true Application Id
app_key true Application Key

Query Parameters

Parameter Required Description
url true The URL to shorten.