Skip to main content

Create application

Creates an application for the same owner as the application of the current connection and issues a low access level token for it. With the app_id and the token from the response you can connect on behalf of the new application right away, and with the app_eui you can create devices in it using create_device_req. The new application delivers data via WebSocket.

Request and response: create_application_req → create_application_resp.
Access: high access level token only. With a low access level token the server responds with error 1.

Request​

Fields not marked as required may be omitted.

FieldTypeDescription
cmdstringcreate_application_req
operation_idstringAny string; the server returns it in the response to match the request and the response
appNamestringRequired. Application name. Uniqueness is not checked
{
"cmd": "create_application_req",
"operation_id": "abc",
"appName": "testApp"
}

Response​

FieldTypeDescription
cmdstringcreate_application_resp
operation_idstringValue from the request
statusuint81 — the application is created, 2 — error
app_idstringApplication identifier, 8 hex characters. Needed to connect
app_euistringApplication AppEUI, 16 hex characters
tokenstringLow access level token, 22 characters: Latin letters and digits
error_code, error_textuint8, stringOnly on error, see below
{
"cmd": "create_application_resp",
"operation_id": "abc",
"status": 1,
"app_id": "358098F3",
"app_eui": "258BD226017CBF01",
"token": "737x6WuNdSBC4VFWhuyHHz"
}

Errors​

error_codeerror_textWhat happened
1Unauthorized accessThe request came with a low access level token
2Required field is not filledappName is missing or empty
3Unexpected errorThe server could not store the application or the token. If the token was not stored, the application already exists — check with get_applications_req
0—Internal server error — retry later

Good to know​

  • A retry creates a second application. The name does not have to be unique, so a request repeated after a connection drop creates one more application. Check the list with get_applications_req before retrying.
  • The token from the response is a low access level token: it gives access to the devices of its application but cannot be used to create devices or applications.

See also​