Application Server APIs

The As service

Method As.SetLink
Description Set a link configuration from the Application Server a Network Server. This call returns immediately after setting the link configuration; it does not wait for a link to establish. To get link statistics or errors, use the GetLinkStats call.
Request type SetApplicationLinkRequest
Response type ApplicationLink
HTTP bindings

PUT /api/v3/as/applications/{application_ids.application_id}/link

Method As.GetLink
Request type GetApplicationLinkRequest
Response type ApplicationLink
HTTP bindings

GET /api/v3/as/applications/{application_ids.application_id}/link

Method As.GetLinkStats
Description GetLinkStats returns the link statistics. This call returns a NotFound error code if there is no link for the given application identifiers. This call returns the error code of the link error if linking to a Network Server failed.
Request type ApplicationIdentifiers
Response type ApplicationLinkStats
HTTP bindings

GET /api/v3/as/applications/{application_id}/link/stats

Method As.DeleteLink
Request type ApplicationIdentifiers
Response type google.protobuf.Empty
HTTP bindings

DELETE /api/v3/as/applications/{application_id}/link

The AppAs service

Method AppAs.DownlinkQueuePush
Request type DownlinkQueueRequest
Response type google.protobuf.Empty
HTTP bindings

POST /api/v3/as/applications/{end_device_ids.application_ids.application_id}/devices/{end_device_ids.device_id}/down/push

Method AppAs.DownlinkQueueReplace
Request type DownlinkQueueRequest
Response type google.protobuf.Empty
HTTP bindings

POST /api/v3/as/applications/{end_device_ids.application_ids.application_id}/devices/{end_device_ids.device_id}/down/replace

Method AppAs.DownlinkQueueList
Request type EndDeviceIdentifiers
Response type ApplicationDownlinks
HTTP bindings

GET /api/v3/as/applications/{application_ids.application_id}/devices/{device_id}/down

Messages

Field Type Description
session_key_id bytes

Join Server issued identifier for the session keys used by this downlink.

max_len: 2048

f_port uint32

gte: 1

lte: 255

not_in: [224]

f_cnt uint32
frm_payload bytes

The frame payload of the downlink message. The payload is encrypted if the skip_payload_crypto field of the EndDevice is true.

decoded_payload google.protobuf.Struct
confirmed bool
class_b_c ApplicationDownlink.ClassBC

Optional gateway and timing information for class B and C. If set, this downlink message will only be transmitted as class B or C downlink. If not set, this downlink message may be transmitted in class A, B and C.

priority TxSchedulePriority

Priority for scheduling the downlink message.

defined_only

correlation_ids repeated string

max_len: 100

Show object example
{
  "session_key_id": "",
  "f_port": 0,
  "f_cnt": 0,
  "frm_payload": "",
  "decoded_payload": {},
  "confirmed": false,
  "class_b_c": {},
  "priority": "LOWEST",
  "correlation_ids": [],
}

Message ApplicationDownlink.ClassBC

Field Type Description
gateways repeated GatewayAntennaIdentifiers

Possible gateway identifiers and antenna index to use for this downlink message. The Network Server selects one of these gateways for downlink, based on connectivity, signal quality, channel utilization and an available slot. If none of the gateways can be selected, the downlink message fails. If empty, a gateway and antenna is selected automatically from the gateways seen in recent uplinks.

absolute_time google.protobuf.Timestamp

Absolute time when the downlink message should be transmitted. This requires the gateway to have GPS time synchronization. If the time is in the past or if there is a scheduling conflict, the downlink message fails. If null, the time is selected based on slot availability. This is recommended in class B mode.

Show object example
{
  "gateways": [],
  "absolute_time": "0001-01-01T00:00:00Z",
}
Field Type Description
downlinks repeated ApplicationDownlink
Show object example
{
  "downlinks": [],
}

Message ApplicationIdentifiers

Field Type Description
application_id string

max_len: 36

pattern: ^[a-z0-9](?:[-]?[a-z0-9]){2,}$

Show object example
{
  "application_id": "",
}
Field Type Description
network_server_address string

The address of the external Network Server where to link to. The typical format of the address is “host:port”. If the port is omitted, the normal port inference (with DNS lookup, otherwise defaults) is used. Leave empty when linking to a cluster Network Server.

pattern: ^(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*(?:[A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])(?::[0-9]{1,5})?$|^$

api_key string

min_len: 1

default_formatters MessagePayloadFormatters
tls bool

Enable TLS for linking to the external Network Server. For cluster-local Network Servers, the cluster’s TLS setting is used.

Show object example
{
  "network_server_address": "",
  "api_key": "",
  "default_formatters": {},
  "tls": false,
}

Message ApplicationLinkStats

Link stats as monitored by the Application Server.

Field Type Description
linked_at google.protobuf.Timestamp
network_server_address string

pattern: ^(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*(?:[A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])(?::[0-9]{1,5})?$|^$

last_up_received_at google.protobuf.Timestamp

Timestamp when the last upstream message has been received from a Network Server. This can be a join-accept, uplink message or downlink message event.

up_count uint64

Number of upstream messages received.

last_downlink_forwarded_at google.protobuf.Timestamp

Timestamp when the last downlink message has been forwarded to a Network Server.

downlink_count uint64

Number of downlink messages forwarded.

Show object example
{
  "linked_at": "0001-01-01T00:00:00Z",
  "network_server_address": "",
  "last_up_received_at": "0001-01-01T00:00:00Z",
  "up_count": 0,
  "last_downlink_forwarded_at": "0001-01-01T00:00:00Z",
  "downlink_count": 0,
}

Message DownlinkQueueRequest

Field Type Description
end_device_ids EndDeviceIdentifiers
downlinks repeated ApplicationDownlink
Show object example
{
  "end_device_ids": {},
  "downlinks": [],
}

Message EndDeviceIdentifiers

Field Type Description
device_id string

max_len: 36

pattern: ^[a-z0-9](?:[-]?[a-z0-9]){2,}$

application_ids ApplicationIdentifiers

required

dev_eui bytes

The LoRaWAN DevEUI.

join_eui bytes

The LoRaWAN JoinEUI (AppEUI until LoRaWAN 1.0.3 end devices).

dev_addr bytes

The LoRaWAN DevAddr.

Show object example
{
  "device_id": "",
  "application_ids": {},
  "dev_eui": "",
  "join_eui": "",
  "dev_addr": "",
}

Message GatewayAntennaIdentifiers

Field Type Description
gateway_ids GatewayIdentifiers

required

antenna_index uint32
Show object example
{
  "gateway_ids": {},
  "antenna_index": 0,
}

Message GatewayIdentifiers

Field Type Description
gateway_id string

max_len: 36

pattern: ^[a-z0-9](?:[-]?[a-z0-9]){2,}$

eui bytes

Secondary identifier, which can only be used in specific requests.

Show object example
{
  "gateway_id": "",
  "eui": "",
}

Message GetApplicationLinkRequest

Field Type Description
application_ids ApplicationIdentifiers

required

field_mask google.protobuf.FieldMask
Show object example
{
  "application_ids": {},
  "field_mask": {},
}

Message MessagePayloadFormatters

Field Type Description
up_formatter PayloadFormatter

Payload formatter for uplink messages, must be set together with its parameter.

defined_only

up_formatter_parameter string

Parameter for the up_formatter, must be set together.

down_formatter PayloadFormatter

Payload formatter for downlink messages, must be set together with its parameter.

defined_only

down_formatter_parameter string

Parameter for the down_formatter, must be set together.

Show object example
{
  "up_formatter": "FORMATTER_NONE",
  "up_formatter_parameter": "",
  "down_formatter": "FORMATTER_NONE",
  "down_formatter_parameter": "",
}

Message SetApplicationLinkRequest

Field Type Description
application_ids ApplicationIdentifiers

required

link ApplicationLink

required

field_mask google.protobuf.FieldMask
Show object example
{
  "application_ids": {},
  "link": {},
  "field_mask": {},
}

Enums

Enum PayloadFormatter

Name Value Description
FORMATTER_NONE 0 No payload formatter to work with raw payload only.
FORMATTER_REPOSITORY 1 Use payload formatter for the end device type from a repository.
FORMATTER_GRPC_SERVICE 2 gRPC service payload formatter. The parameter is the host:port of the service.
FORMATTER_JAVASCRIPT 3 Custom payload formatter that executes Javascript code. The parameter is a JavaScript filename.
FORMATTER_CAYENNELPP 4 CayenneLPP payload formatter.

Enum TxSchedulePriority

Name Value Description
LOWEST 0
LOW 1
BELOW_NORMAL 2
NORMAL 3
ABOVE_NORMAL 4
HIGH 5
HIGHEST 6