Supported HTTP formats for sending data to JEDI One

There are a variety of ways to send data to JEDI One via HTTP, including HTTP POST and Query Parameters.  Below are examples of acceptable data formatting.  Substitute 'localhost' with the IP address for the platform running JEDI One, where appropriate.  Examples use the Linux 'curl' command.  

Also note that the timestamp is in iso:8601 format i.e.:  2021-04-14T02:22:33-0700 

Compatibility mode version 1 (JSON Data)

URL Method: POST v1/data/for/DeviceID

Request Body:

{

"key1": 77,"key2": 55,

"timestamp":<timestamp>

}

Example:

curl -X POST \
http://localhost:8100/v1/data/for/weather2 \
-H 'Content-Type: application/json' \
-d '{"key1": 77, "key2": 55, "timestamp":"2021-04-14T02:22:33-0700"}'

Compatibility mode version 1 (Query Params)

URL Method: POST v1/data/for/DeviceID?key1=val1&key2=val2&timestamp=<timestamp>

Request Body:

None

Example:

curl -X POST \
'http://localhost:8100/v1/data/for/weather3?key1=78&key2=21&timestamp=2021-04-14T02:22:33-0700'

Compatibility mode version 2 (JSON Data)

URL Method: POST v2/data

Request Body:

{

"target":"weather2",

“timestamp”:<timestamp>

"content":{"key1":79, “key2”:30}

}

Example:

curl -X POST \
http://localhost:8100/v2/data \
-H 'Content-Type: application/json' \
-d '{
"target":"weather2",
"content":{"key1":79,"key2":30},
"timestamp":"2021-04-14T02:22:33-0700"
}'

Machinechat mode (JSON Data)

URL Method: POST v1/data/mc

Request Body:

{

"context": {

"target_id": "KeySensor",

"target_ip": "192.168.2.1",

“timestamp”:<timestamp>

},

"data": {

"key1": 30,

"key2": 20

}

}

Example:

curl -X POST \
http://localhost:8100/v1/data/mc \
-H 'Content-Type: application/json' \
-d '{
"context": {
"target_id": "KeySensor",
"target_ip": "192.168.2.1",
"timestamp":"2021-04-14T02:22:33-0700"
},
"data": {
"key1": 30,
"key2": 20
}
}'

See also:

Sending data to JEDI One using the HTTP POST method - Python example

Was this article helpful?
0 out of 0 found this helpful