smart-extract-documentation
v4.1.1
v4.1.1
  • SmartExtract
  • API Reference
    • Data Extraction API
      • Authentication
      • SmartExtract JSON API
    • Admin API
      • API Key Management
      • Extraction Logs API
  • smart-extract.js
    • Integration Overview
    • SmartExtract API
    • SmartExtractSimple API
    • Styling and Customisations
    • Pre-Fillling Extraction Form
    • Performing Multiple Extraction
    • Code Examples
      • SmartExtract API Examples
      • SmartExtractSimple API Examples
  • Appendix
Powered by GitBook
On this page
  • Create new API Key
  • List API Keys
  • Update an API Key
  • Delete an API Key
  • Gets API Key details
  • Create new API Key
  • List API Keys
  • Update an API Key
  • Delete an API Key
  • Gets API Key details
  1. API Reference
  2. Admin API

API Key Management

The API-Key Management APIs provide interface to manage API Keys. This is helpful if you need to maintain different sets of API Keys for different users/accounts on your platform.

For Production environment:

Create new API Key

POST https://api.clik.ai/smart-extract-api/api/account/v1/api-keys

This API lets you create a new API Key.

Headers

Name
Type
Description

Authorization

String

Basic <base 64 encoded credentials>

Request Body

Name
Type
Description

name*

string

Name of the API Key

enabled*

boolean

Create the API Key in enabled/disabled state

roles*

string[]

List of roles to attach to the API Key.

DATA_EXTRACTION - Allows the API Key access to data extraction APIs

ADMIN_ROLE - Allows the API Key access to admin APIs e.g. API Keys Management API

{
    "status": "error",
    "type": "unauthorizedApiKeyError",
    "error": {
        "message": "The API Key used does not have privilege to perform the intended action"
    }
}
{
    "apiKey": {
        "enabled": true,
        "key": "52ee4d982ee6b2e0432f10c4d03a1b8a",
        "name": "xyz",
        "roles": [
            "DATA_EXTRACTION"
        ],
        "id": "84af7719-202f-430f-8d33-fdf0a7220b14",
        "createdAt": "2021-11-25T06:20:16.829Z",
        "updatedAt": "2021-11-25T06:20:16.829Z",
        "secret": "9156a891d9d21fa98e9c54cf62815d46"
    }
}

List API Keys

GET https://api.clik.ai/smart-extract-api/api/account/v1/api-keys

This API returns a list of API Keys in the system

Query Parameters

Name
Type
Description

page

number

API Keys list response page. Defaults to 1

pageSize

number

Number of records to return for a page. Defaults to 100

{
    "status": "error",
    "type": "unauthorizedApiKeyError",
    "error": {
        "message": "The API Key used does not have privilege to perform the intended action"
    }
}
{
    "apiKeys": [
        {
            "id": "0300d235-87cb-4563-acb3-1825dbe34069",
            "enabled": true,
            "name": "Test Key 1",
            "key": "7d0878b65ff21abb875a64586ea9366e",
            "createdAt": "2021-11-16T09:32:07.456Z",
            "updatedAt": "2021-11-16T09:32:07.456Z",
            "roles": [
                "ADMIN_ROLE"
            ]
        },
        {
            "id": "13d2e1b5-45ff-436d-ac98-3a94670b3cf2",
            "enabled": true,
            "name": "Test Key 2",
            "key": "fc9fb2c051f2be65c6faef47f3758148",
            "createdAt": "2021-11-16T08:52:30.260Z",
            "updatedAt": "2021-11-16T08:52:30.260Z",
            "roles": [
                "DATA_EXTRACTION",
            ]
        }
    ],
    "page": 1,
    "pageSize": 100
}

Update an API Key

PATCH https://api.clik.ai/smart-extract-api/api/account/v1/api-keys/{apiKeyId}

This API updates an API Key's name, enabled status and roles

Path Parameters

Name
Type
Description

apiKeyId*

string

The id of the API Key

Request Body

Name
Type
Description

name

string

The name of the API Key

enabled

string

The enabled status of the API Key

roles

string[]

Roles to assign to the API Key. Valid roles are ADMIN_ROLE and DATA_EXTRACTION

{
    "apiKey": {
        "id": "0300d235-87cb-4563-acb3-1825dbe34069",
        "enabled": true,
        "name": "Test API Key",
        "key": "7d0878b65ff21abb875a64586ea9366e",
        "createdAt": "2021-11-16T09:32:07.456Z",
        "updatedAt": "2021-11-25T06:34:31.000Z",
        "roles": [
            "DATA_EXTRACTION",
            "ADMIN_ROLE"
        ]
    }
}

Delete an API Key

DELETE https://api.clik.ai/smart-extract-api/api/account/v1/api-keys/{apiKeyId}

Deletes an API Key from the account

Path Parameters

Name
Type
Description

apiKeyId

string

The id of the API Key to be deleted

{
    // Response
}

Gets API Key details

GET https://api.clik.ai/smart-extract-api/api/account/v1/api-keys/{apiKeyId}

Returns details for an API Key

Path Parameters

Name
Type
Description

apiKeyId

string

The API Key id

{
    "apiKey": {
        "id": "13d2e1b5-45ff-436d-ac98-3a94670b3cf2",
        "enabled": true,
        "name": "Test API Key",
        "key": "fc9fb2c051f2be65c6faef47f3758148",
        "createdAt": "2021-11-16T08:52:30.260Z",
        "updatedAt": "2021-11-16T08:52:30.260Z",
        "roles": [
            "DATA_EXTRACTION",
            "ADMIN_ROLE"
        ]
    }
}

For Staging environment:

Create new API Key

POST https://api.clik.ai/smart-extract-stg-api/api/account/v1/api-keys

This API lets you create a new API Key.

Headers

Name
Type
Description

Authorization

String

Basic <base 64 encoded credentials>

Request Body

Name
Type
Description

name*

string

Name of the API Key

enabled*

boolean

Create the API Key in enabled/disabled state

roles*

string[]

List of roles to attach to the API Key.

DATA_EXTRACTION - Allows the API Key access to data extraction APIs

ADMIN_ROLE - Allows the API Key access to admin APIs e.g. API Keys Management API

{
    "status": "error",
    "type": "unauthorizedApiKeyError",
    "error": {
        "message": "The API Key used does not have privilege to perform the intended action"
    }
}
{
    "apiKey": {
        "enabled": true,
        "key": "52ee4d982ee6b2e0432f10c4d03a1b8a",
        "name": "xyz",
        "roles": [
            "DATA_EXTRACTION"
        ],
        "id": "84af7719-202f-430f-8d33-fdf0a7220b14",
        "createdAt": "2021-11-25T06:20:16.829Z",
        "updatedAt": "2021-11-25T06:20:16.829Z",
        "secret": "9156a891d9d21fa98e9c54cf62815d46"
    }
}

List API Keys

GET https://api.clik.ai/smart-extract-stg-api/api/account/v1/api-keys

This API returns a list of API Keys in the system

Query Parameters

Name
Type
Description

page

number

API Keys list response page. Defaults to 1

pageSize

number

Number of records to return for a page. Defaults to 100

{
    "status": "error",
    "type": "unauthorizedApiKeyError",
    "error": {
        "message": "The API Key used does not have privilege to perform the intended action"
    }
}
{
    "apiKeys": [
        {
            "id": "0300d235-87cb-4563-acb3-1825dbe34069",
            "enabled": true,
            "name": "Test Key 1",
            "key": "7d0878b65ff21abb875a64586ea9366e",
            "createdAt": "2021-11-16T09:32:07.456Z",
            "updatedAt": "2021-11-16T09:32:07.456Z",
            "roles": [
                "ADMIN_ROLE"
            ]
        },
        {
            "id": "13d2e1b5-45ff-436d-ac98-3a94670b3cf2",
            "enabled": true,
            "name": "Test Key 2",
            "key": "fc9fb2c051f2be65c6faef47f3758148",
            "createdAt": "2021-11-16T08:52:30.260Z",
            "updatedAt": "2021-11-16T08:52:30.260Z",
            "roles": [
                "DATA_EXTRACTION",
            ]
        }
    ],
    "page": 1,
    "pageSize": 100
}

Update an API Key

PATCH https://api.clik.ai/smart-extract-stg-api/api/account/v1/api-keys/{apiKeyId}

This API updates an API Key's name, enabled status and roles

Path Parameters

Name
Type
Description

apiKeyId*

string

The id of the API Key

Request Body

Name
Type
Description

name

string

The name of the API Key

enabled

string

The enabled status of the API Key

roles

string[]

Roles to assign to the API Key. Valid roles are ADMIN_ROLE and DATA_EXTRACTION

{
    "apiKey": {
        "id": "0300d235-87cb-4563-acb3-1825dbe34069",
        "enabled": true,
        "name": "Test API Key",
        "key": "7d0878b65ff21abb875a64586ea9366e",
        "createdAt": "2021-11-16T09:32:07.456Z",
        "updatedAt": "2021-11-25T06:34:31.000Z",
        "roles": [
            "DATA_EXTRACTION",
            "ADMIN_ROLE"
        ]
    }
}

Delete an API Key

DELETE https://api.clik.ai/smart-extract-stg-api/api/account/v1/api-keys/{apiKeyId}

Deletes an API Key from the account

Path Parameters

Name
Type
Description

apiKeyId

string

The id of the API Key to be deleted

{
    // Response
}

Gets API Key details

GET https://api.clik.ai/smart-extract-stg-api/api/account/v1/api-keys/{apiKeyId}

Returns details for an API Key

Path Parameters

Name
Type
Description

apiKeyId

string

The API Key id

{
    "apiKey": {
        "id": "13d2e1b5-45ff-436d-ac98-3a94670b3cf2",
        "enabled": true,
        "name": "Test API Key",
        "key": "fc9fb2c051f2be65c6faef47f3758148",
        "createdAt": "2021-11-16T08:52:30.260Z",
        "updatedAt": "2021-11-16T08:52:30.260Z",
        "roles": [
            "DATA_EXTRACTION",
            "ADMIN_ROLE"
        ]
    }
}
PreviousAdmin APINextExtraction Logs API

Last updated 1 year ago