Skip to content

API Keys

sadhasivam edited this page Sep 10, 2024 · 1 revision

Add New API Key

URL: /api/admin/addnewapi

Method: POST

Description: Adds a new API key.

Parameters

Parameter Type Required/Optional Description
api_key_secret String Required The secret key for the API.
api_key_ip String Optional Comma-separated list of IP addresses that are allowed to use the API key.
api_key_clients_add Boolean Required Permission to add clients using this API key.
api_key_clients_edit Boolean Required Permission to edit clients using this API key.
api_key_licenses_add Boolean Required Permission to add licenses using this API key.
api_key_licenses_edit Boolean Required Permission to edit licenses using this API key.
api_key_products_add Boolean Required Permission to add products using this API key.
api_key_products_edit Boolean Required Permission to edit products using this API key.
api_key_installations_edit Boolean Required Permission to edit installations using this API key.
api_key_search Boolean Required Permission to perform searches using this API key.
api_key_status String Required Status of the API key (e.g., "active", "inactive").
api_key_description String Optional Description of the API key.

Response

{
    "success": true,
    "message": "API Key Added Successfully",
    "data": {
        "api_key_secret": "N1TUYBUWIE6WTYG3J",
        "api_key_ip": null,
        "api_key_clients_add": 1,
        "api_key_clients_edit": 1,
        "api_key_licenses_add": 1,
        "api_key_licenses_edit": 1,
        "api_key_products_add": 1,
        "api_key_products_edit": 1,
        "api_key_installations_edit": 1,
        "api_key_search": 1,
        "api_key_status": 1,
        "api_key_description": "new api key",
        "updated_at": "2024-09-10T05:28:46.000000Z",
        "created_at": "2024-09-10T05:28:46.000000Z",
        "api_key_id": 2
    }
}

Edit API Key

URL: /api/admin/editnewapi/{api_key_id}

Method: POST

Description: Updates an existing API key.

Parameters

Parameter Type Required/Optional Description
api_key_secret String Optional The secret key for the API. Leave empty if you do not want to change it.
api_key_ip String Optional Comma-separated list of IP addresses that are allowed to use the API key. Leave empty if you do not want to change it.
api_key_clients_add Boolean Optional Permission to add clients using this API key. Leave empty if you do not want to change it.
api_key_clients_edit Boolean Optional Permission to edit clients using this API key. Leave empty if you do not want to change it.
api_key_licenses_add Boolean Optional Permission to add licenses using this API key. Leave empty if you do not want to change it.
api_key_licenses_edit Boolean Optional Permission to edit licenses using this API key. Leave empty if you do not want to change it.
api_key_products_add Boolean Optional Permission to add products using this API key. Leave empty if you do not want to change it.
api_key_products_edit Boolean Optional Permission to edit products using this API key. Leave empty if you do not want to change it.
api_key_installations_edit Boolean Optional Permission to edit installations using this API key. Leave empty if you do not want to change it.
api_key_search Boolean Optional Permission to perform searches using this API key. Leave empty if you do not want to change it.
api_key_status String Optional Status of the API key (e.g., "active", "inactive"). Leave empty if you do not want to change it.
api_key_description String Optional Description of the API key. Leave empty if you do not want to change it.
api_key_id Integer Required The ID of the API key to update.

Response

{
    "success": true,
    "message": "The Current API Key Details Has Been Updated",
    "data": 1
}

Delete API Key

URL: /api/admin/deleteapi/{api_key_id}

Method: POST

Description: Deletes the specified API key.

Parameters

Parameter Type Required/Optional Description
api_key_id Integer Required The ID of the API key to delete.

Response

{
    "success":true,
    "message":"API Key Deleted Successfully",
    "data":1
}

View API Key

URL: /api/admin/viewApiKeys/{api_key_id}

Method: GET

Description: Retrieves details of the specified API key.

Parameters

Parameter Type Required/Optional Description
api_key_id Integer Required The ID of the API key to retrieve.

Response

{
    "success": true,
    "data": {
        "api_key": {
            "api_key_id": 2,
            "api_key_secret": "NJGSVUW6WTYG35",
            "api_key_ip": null,
            "api_key_clients_add": 1,
            "api_key_clients_edit": 1,
            "api_key_licenses_add": 1,
            "api_key_licenses_edit": 1,
            "api_key_products_add": 1,
            "api_key_products_edit": 1,
            "api_key_installations_edit": 1,
            "api_key_search": 1,
            "api_key_status": 1,
            "api_key_description": "new api key",
            "created_at": "2024-09-10T05:28:46.000000Z",
            "updated_at": "2024-09-10T05:28:46.000000Z",
            "api_key_versions_add": 1,
            "api_key_versions_edit": 1
        }
    }
}

View API Keys

URL: /api/admin/admin/viewApiKeys

Method: GET

Description: Retrieves a list of API keys.

Parameters

This endpoint does not require any parameters.

Response

{
    "success": true,
    "message": "lang.Api_show",
    "data": [
            {
                "api_key_id": 2,
                "api_key_secret": "NJGSVUW6WTYG35",
                "api_key_ip": null,
                "api_key_clients_add": 1,
                "api_key_clients_edit": 1,
                "api_key_licenses_add": 1,
                "api_key_licenses_edit": 1,
                "api_key_products_add": 1,
                "api_key_products_edit": 1,
                "api_key_installations_edit": 1,
                "api_key_search": 1,
                "api_key_status": 1,
                "api_key_description": "new api key",
                "created_at": "2024-09-10T05:28:46.000000Z",
                "updated_at": "2024-09-10T05:28:46.000000Z",
                "api_key_versions_add": 1,
                "api_key_versions_edit": 1
            },
            {
                "api_key_id": 1,
                "api_key_secret": "GHDVKND9gTLfPL",
                "api_key_ip": "",
                "api_key_clients_add": 1,
                "api_key_clients_edit": 1,
                "api_key_licenses_add": 1,
                "api_key_licenses_edit": 1,
                "api_key_products_add": 1,
                "api_key_products_edit": 1,
                "api_key_installations_edit": 1,
                "api_key_search": 1,
                "api_key_status": 1,
                "api_key_description": null,
                "created_at": null,
                "updated_at": null,
                "api_key_versions_add": 1,
                "api_key_versions_edit": 1
            }
        ],
}

Clone this wiki locally