This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
wiki:oss_api [2017/11/07 17:09] tda |
wiki:oss_api [2019/06/20 16:35] (current) tda |
||
---|---|---|---|
Line 3: | Line 3: | ||
The OSS has several interfaces that can be accessed through APIs. | The OSS has several interfaces that can be accessed through APIs. | ||
- | {{:wiki:oss_overview.png|}} | + | {{:wiki3:gms_overview_3x.png|}} |
===== REST ===== | ===== REST ===== | ||
Line 91: | Line 91: | ||
} | } | ||
</code> | </code> | ||
+ | |||
+ | === Requesting the customer ID === | ||
+ | |||
+ | <code bash> | ||
+ | $ curl -s 'https://wanesyserver.tld/oss/application/authenticatedUser' \ | ||
+ | -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJzdXBlcmFkbW ... n6i5WboHR-I' \ | ||
+ | -H 'Content-Type: application/vnd.kerlink.iot-v1+json;charset=UTF-8' \ | ||
+ | -H 'Accept: application/json, text/plain, */*' \ | ||
+ | | jq '.links[] | select(.rel=="customer") | .href' | ||
+ | </code> | ||
+ | |||
+ | The ''jq'' filter is used to show only customer ID information. In fact, it will display the ''href'' value for all ''links'' objects for which the ''rel'' key has the ''customer'' value. | ||
+ | |||
+ | Example result with customer ID number ''23'': | ||
+ | |||
+ | <code javascript> | ||
+ | "/application/customers/23" | ||
+ | </code> | ||
+ | |||
+ | === Sending data to an endpoint === | ||
+ | |||
+ | Not all fields in ''TxMessageDto'' are required when creating a new TX message. The actual parameters to send are: | ||
+ | |||
+ | * ''port'': integer, LoRaWAN application port number | ||
+ | * ''payload'': string, data payload, either encoded as an hex string or binary data in base64 | ||
+ | * ''ack'': boolean, whether the TX message should be acknowledged (confirmed data transfer) | ||
+ | * ''contentType'': enum { ''TEXT'', ''HEXA'' }, describes how the payload is encoded | ||
+ | * ''maxRetry'': integer (optional), maximum number of transmission attempts. Only required if ''ack'' is ''true''. | ||
+ | * ''timeToLive'': integer (optional), time to live. Only required if ''ack'' is ''true''. | ||
+ | |||
+ | No other parameter is supported. |