ClientList Partner API

General notes

Api is available at https://cloud.clientlist.io/partner-api/v1 under this conditions:

  • API always return JSON
  • content_type = application/json
  • authorization using HMAC
  • every right answer contains {“status”: “ok”}

Standard answers

Confirmation

{ “status”: “ok” } * always HTTP STATUS equals 200 * field status = “ok”

Error

{ “status”: “error”, “error”: “AccessDenied” } * error always has HTTP STATUS different than 200 (400,401,403,404,500) * it’s field status = “error” * error field can have additional parameter

Calculating a control sum of HMAC for GET and DELETE

X-hmac = hash_hmac(‘SHA1’ ,PUBLIC+REQUEST_PATH+HTTP_PARAMS, PRIVATE)

Calculating a control sum of HMAC for POST and PUT

X-hmac = hash_hmac(‘SHA1’, PUBLIC+REQUEST_PATH+HTTP_POST_JSON_BODY, PRIVATE)

API detail

Dictionary

Dictionary: Languages

curl -X GET -H "X-public: 833433b3adb6df69a79cb7af42f0b356" -H "X-hmac: calculated_hmac" "https://cloud.clientlist.io/partner-api/v1/language"
GET /partner-api/v1/language HTTP/1.1
Host: cloud.clientlist.io
X-public: 833433b3adb6df69a79cb7af42f0b356
X-hmac: calculated_hmac
Status200 OK
{
    "status": "ok",
    "data": [
        {
            "id": 1,
            "name": "English"
        },
        {
            "id": 2,
            "name": "Polski"
        },
        {
            "id": 3,
            "name": "German"
        },
        {
            "id": 4,
            "name": "French"
        },
        {
            "id": 5,
            "name": "Italian"
        },
        {
            "id": 6,
            "name": "Spanish"
        },
        {
            "id": 7,
            "name": "Arabic"
        },
        {
            "id": 8,
            "name": "Russian"
        }
    ]
}

User

User: Get

curl -X GET -H "X-public: 833433b3adb6df69a79cb7af42f0b356" -H "X-hmac: callculated_hmac" "https://cloud.clientlist.io/partner-api/v1/user/{id}"
GET /partner-api/v1/user/%7Bid%7D HTTP/1.1
Host: cloud.clientlist.io
X-public: 833433b3adb6df69a79cb7af42f0b356
X-hmac: callculated_hmac
Status200 OK
{
    "status": "ok",
    "data": {
        "id": 2005,
        "name": "partner@example.com",
        "email": "partner@example.com",
        "language": 1,
        "timezone": "Europe/Warsaw",
        "status": true,
        "added": "2020-11-02 08:53:12",
        "lastLogin": "2020-11-02 08:53:12"
    }
}

User: Add

curl -X POST -H "X-public: 833433b3adb6df69a79cb7af42f0b356" -H "X-hmac: callculated_hmac" -d '{
    "email": "partner@example.com",
    "password": "password1",
    "language": 1,
    "timezone": "Europe/Warsaw"
}' "https://cloud.clientlist.io/partner-api/v1/user"
POST /partner-api/v1/user HTTP/1.1
Host: cloud.clientlist.io
X-public: 833433b3adb6df69a79cb7af42f0b356
X-hmac: callculated_hmac

{
    "email": "partner@example.com",
    "password": "password1",
    "language": 1,
    "timezone": "Europe/Warsaw"
}
Status200 OK
{
    "status": "ok",
    "data": {
        "id": 2005,
        "name": "partner@example.com",
        "email": "partner@example.com",
        "language": 1,
        "timezone": "Europe/Warsaw",
        "status": true,
        "added": "2020-11-02 08:53:12",
        "lastLogin": "2020-11-02 08:53:12"
    }
}

User: Status

curl -X PUT -H "X-public: 833433b3adb6df69a79cb7af42f0b356" -H "X-hmac: callculated_hmac" -d '{
    "status": false
}' "https://cloud.clientlist.io/partner-api/v1/user/{id}/status"
PUT /partner-api/v1/user/%7Bid%7D/status HTTP/1.1
Host: cloud.clientlist.io
X-public: 833433b3adb6df69a79cb7af42f0b356
X-hmac: callculated_hmac

{
    "status": false
}
Status200 OK
{
    "status": "ok",
    "data": {
        "id": 2005,
        "name": "partner@example.com",
        "email": "partner@example.com",
        "language": 1,
        "timezone": "Europe/Warsaw",
        "status": false,
        "added": "2020-11-02 08:53:12",
        "lastLogin": "2020-11-02 08:53:12"
    }
}

User: Change password

curl -X PUT -H "X-public: 833433b3adb6df69a79cb7af42f0b356" -H "X-hmac: callucalted_hmac" -d '{
    "password": "password2"
}' "https://cloud.clientlist.io/partner-api/v1/user/{id}/password"
PUT /partner-api/v1/user/%7Bid%7D/password HTTP/1.1
Host: cloud.clientlist.io
X-public: 833433b3adb6df69a79cb7af42f0b356
X-hmac: callucalted_hmac

{
    "password": "password2"
}
Status200 OK
{
    "status": "ok",
    "data": {
        "id": 2005,
        "name": "partner@example.com",
        "email": "partner@example.com",
        "language": 1,
        "timezone": "Europe/Warsaw",
        "status": false,
        "added": "2020-11-02 08:53:12",
        "lastLogin": "2020-11-02 08:53:12"
    }
}

User: Remove

curl -X DELETE -H "X-public: 833433b3adb6df69a79cb7af42f0b356" -H "X-hmac: callculated_hmac" "https://cloud.clientlist.io/partner-api/v1/user/{id}"
DELETE /partner-api/v1/user/%7Bid%7D HTTP/1.1
Host: cloud.clientlist.io
X-public: 833433b3adb6df69a79cb7af42f0b356
X-hmac: callculated_hmac
Status200 OK
{
    "status": "ok"
}

User: Sign in

curl -X POST -H "X-public: 833433b3adb6df69a79cb7af42f0b356" -H "X-hmac: callculated_hmac" -d '{
    "email": "partner@example.com"
}' "https://cloud.clientlist.io/partner-api/v1/user/login-email"
POST /partner-api/v1/user/login-email HTTP/1.1
Host: cloud.clientlist.io
X-public: 833433b3adb6df69a79cb7af42f0b356
X-hmac: callculated_hmac

{
    "email": "partner@example.com"
}
Status200 OK
{
    "status": "ok",
    "data": {
        "hash": "13aa2c620760e92e279053530d294b47",
        "url": "https://cloud.clientlist.io/login-otp/13aa2c620760e92e279053530d294b47"
    }
}