PORTOS Developers
  • πŸ‘‹Introduction
  • πŸ“–Glossary
  • HTTP Status codes
  • Error models
  • Error codes
  • Validation constraints
  • Resource names
  • πŸ”’User rights
  • Device environments
  • 🌍Localization
  • πŸ”NData query syntax
  • OpenAPI specification
  • Data models
  • Authentication
    • πŸ”Authentication schemes
      • JWT Bearer Authentication
      • HMAC Authentication
  • ⚑Notifications
    • SignalR
    • Webhooks
  • API reference
    • πŸ”‘API keys
    • πŸ›οΈArticle categories
    • πŸ’ΌCompanies
    • πŸ’±Currencies
    • πŸ‘«Customers
    • πŸ“ˆDaily sales reports
    • πŸ–₯️Devices
    • πŸ–¨οΈFiscals
    • ❀️Health check
    • πŸ“ƒLicense
    • 🎚️Modifiers
    • πŸ‘¨β€πŸ³Order endpoints
    • πŸ›ŽοΈOrders
    • πŸͺ™Payment types
    • β˜•Plus
    • πŸ”Roles
    • πŸ”Sessions
    • βš™οΈSettings
    • πŸ”ŽStock takings
    • πŸ”’Stock transfer numbering
    • 🚚Stock transfers
    • πŸ“¦Stocks
    • 🧾Tickets
      • Ticket Model States
      • Ticket Operations and User Rights
      • Ticket Model Mathematics
    • πŸ‘¨β€πŸ’ΌUsers
    • βš–οΈVats
    • πŸͺ‘Zones
  • 3rd Party Integrations
    • Introduction
    • Online orders API
    • Rewards API
    • PDA Files
  • Previous versions
    • Migration to V4.1
    • Migration to V4
    • Legacy documentation
Powered by GitBook
On this page
  • API methods
  • Get API keys
  • Get API key
  • Create API key
  • Create or update API key
  • Delete API key

Was this helpful?

  1. API reference

API keys

This page provides a description of the available API routes for managing API keys.

PreviousWebhooksNextArticle categories

Last updated 1 year ago

Was this helpful?

API key used in and is represented by class.

To enable API key usage, the API key must be activated by setting the isActive field to true. Once the API key is authorized on the server, the request will be executed within the context of the user specified by their userName, operating on the device specified by the deviceName.

API methods

Get API keys

GET http://{server-address}/apikeys

Returns all API keys that matches query parameters. Result is of type .

Query Parameters

Name
Type
Description

id

string

Supports NData syntax.

isActive

bool

Supports NData syntax.

$skip

int

Pagination property. Describing number of records to skip from beginning of result collection.

$take

int

Pagination property. Maximum count of items to be returned.

$sort

string[]

Comma separated list of property names. Please see NData syntax.

$count

bool

If set to true, response will not contain items collection. Use to get resource count, not the resources themselves.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "items": [
        {
            "id": "64b00bc5ba312b6744126a87",
            "clientId": "60f33924e92a4262763a08230c6c385f33c497f3",
            "clientSecret": "df80d7cae59b9a9c3ee76a3750f80ef9d0c9398083d0dc591952cd675926944c",
            "isActive": true,
            "createdAt": "2023-07-13T14:35:49.506Z",
            "name": "My API key",
            "description": "This is an API key description",
            "userName": "john.doe",
            "deviceName": "BackOffice",
            "permissions": [],
            "_v": 1
        }
    ],
    "count": 1,
    "totalCount": 1
}

Get API key

GET http://{server-address}/apikeys/{id}

Path Parameters

Name
Type
Description

id*

string

Unique identifier.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "id": "64b00bc5ba312b6744126a87",
    "clientId": "60f33924e92a4262763a08230c6c385f33c497f3",
    "clientSecret": "df80d7cae59b9a9c3ee76a3750f80ef9d0c9398083d0dc591952cd675926944c",
    "isActive": true,
    "createdAt": "2023-07-13T14:35:49.506Z",
    "name": "My API key",
    "description": "This is an API key description",
    "userName": "john.doe",
    "deviceName": "BackOffice",
    "permissions":
    [],
    "_v": 1
}
{
    "title": "Zdroj nebol nΓ‘jdenΓ½",
    "status": 404
}

Create API key

POST http://{server-address}/apikeys

Required rights

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(body)*

ApiKey

Model to create.

{
    "id": "64b00bc5ba312b6744126a87",
    "clientId": "60f33924e92a4262763a08230c6c385f33c497f3",
    "clientSecret": "df80d7cae59b9a9c3ee76a3750f80ef9d0c9398083d0dc591952cd675926944c",
    "isActive": true,
    "createdAt": "2023-07-13T14:35:49.506Z",
    "name": "My API key",
    "description": "This is an API key description",
    "userName": "john.doe",
    "deviceName": "BackOffice",
    "permissions":
    [],
    "_v": 1
}

Create or update API key

PUT http://{server-address}/apikeys/{id}

Required rights

Path Parameters

Name
Type
Description

id*

string

Unique identifier.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(body)*

ApiKey

Model to create or update.

{
    "id": "64b00bc5ba312b6744126a87",
    "clientId": "60f33924e92a4262763a08230c6c385f33c497f3",
    "clientSecret": "df80d7cae59b9a9c3ee76a3750f80ef9d0c9398083d0dc591952cd675926944c",
    "isActive": true,
    "createdAt": "2023-07-13T14:35:49.506Z",
    "name": "My API key",
    "description": "This is an API key description",
    "userName": "john.doe",
    "deviceName": "BackOffice",
    "permissions":
    [],
    "_v": 2
}

Delete API key

DELETE http://{server-address}/apikeys/{id}

Required rights

Path Parameters

Name
Type
Description

id*

string

Unique identifier.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "id": "64b00bc5ba312b6744126a87",
    "clientId": "60f33924e92a4262763a08230c6c385f33c497f3",
    "clientSecret": "df80d7cae59b9a9c3ee76a3750f80ef9d0c9398083d0dc591952cd675926944c",
    "isActive": true,
    "createdAt": "2023-07-13T14:35:49.506Z",
    "name": "My API key",
    "description": "This is an API key description",
    "userName": "john.doe",
    "deviceName": "BackOffice",
    "permissions":
    [],
    "_v": 1
}
{
    "title": "Zdroj nebol nΓ‘jdenΓ½",
    "status": 404
}

Result is of type .

Creates new API key. Result is of type .

Authorized user must have ApiKeyCreate assigned.

Creates new or updates existing API key. Result is of type .

Authorized user must have assigned ApiKeyCreate or ApiKeyUpdate .

Authorized user must have ApiKeyDelete assigned.

πŸ”‘
right
right
right
HMAC authenticaton scheme
ApiKey
QueryResult<ApiKey>
API key
API key
API key