Skip to main content
Skip table of contents

Creating a code

After the code is created, a push notification with the code object will be sent to the user's websocket channel (user.{ID}). The push notification will not be sent to the device that initiated this request

POST/api/v1/intercom/{intercom}/codes

Headers

Authorization

Bearer token

Accept

application/json

X-Client

ios-cctv|android-cctv|thick-legal|web

X-UUID

unique device id

Body

json

JSON
{
    "title": "new code",
    "expired_at": "2029-12-31 12:45"
}

intercomoptional

int

Intercom identifier for which the code needs to be created

titlerequired

string

Code name

titlerequired

string

Expiration date for the code

Response

200

Successful response

JSON
{
    "id": 1388,
    "title": "Visitor 1",
    "code": "12345",
    "expired_at": "2022-04-19 17:16:00",
    "is_expired": true,
    "will_deleted_at": "2022-04-20 17:16:00",
    "created_at": "2022-04-19 17:14:04",
    "intercom": {
        "id": 180,
        "title": "House",
        "is_online": true,
        "department": 100,
        "address": "Cameras",
        "created_at": null,
        "updated_at": "2022-04-18T17:25:56.000000Z"
    }
}
401

Authorization token not provided or invalid, see Obtaining a token

422

Returns a JSON object with an error, see Validation

JSON
{
    "message": "There won't be any informative message here",
    "errors": {
        "any_key": [
            "Here the error cause will be described"
        ]
    }
}

Example

JSON
curl -k --location --request POST 'https://vms.local/api/v1/intercom/{intercom}/codes' \
--header 'Authorization:Bearer token' \
--header 'Accept:application/json' \
--header 'X-Client:ios-cctv|android-cctv|thick-legal|web' \
--header 'X-UUID:unique device id' \
--header 'Content-Type: application/json \
--data-raw '{
    "title": "new code",
    "expired_at": "2029-12-31 12:45"
}'
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.