Base URL
https://{tenant}.logzi.com/api/unit/
Every request returns a JSON response. On success result.code == 1, on failure result.code == 0.
/api/unit/get
Retrieve a single unit of measure by ID, with full details.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | int | Unique identifier of the unit of measure | |
language_id | int | Language ID |
Example request
GET /api/unit/get?id=1
X-API-KEY: {your_api_key}
/api/unit/list
Retrieve the list of all units of measure.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
language_id | int | Language ID for localized names |
Example request
GET /api/unit/list
X-API-KEY: {your_api_key}
/api/unit/save
Create or update a unit of measure. Use data[id] = 0 for a new record.
POST fields — data object
| Field | Type | Required | Description |
|---|---|---|---|
id | int | 0 = new unit of measure, >0 = update | |
name_key | string | Internal key name (e.g. "db", "kg", "liter") | |
name_short | string | Short display name (e.g. "db", "kg") |
Example request
POST /api/unit/save
X-API-KEY: {your_api_key}
Content-Type: application/json
{
"data": {
"id": 0,
"name_key": "kg",
"name_short": "kg"
}
}
/api/unit/delete
Delete a unit of measure by ID.
POST fields — data object
| Field | Type | Required | Description |
|---|---|---|---|
id | int | ID of the unit of measure to delete |
Example request
POST /api/unit/delete
X-API-KEY: {your_api_key}
Content-Type: application/json
{ "data": { "id": 4 } }
Create your account now,
pay later!