Skip to main content

Register source

Register a device for sending custom data using the Custom events endpoint.

URL

POST /v1/sessions/:sessionId/events

Request URL Parameters

ParameterDescription
:sessionIdID of the session to add events.

Request Body

name
string
Required
Name to identify the source.
format
enum SourceFormat
Required
Possible enum values
text
Text type data.
scalar
Single numeric value data.

Response Body

Registered device

id
string
ID of the registered device.
Example: eff2e60e-36c1-411f-bd7c-a3ebba93933f
name
string
Name of the device.
Example: My Heartband
device
string
Type of device this source belongs to. Currently it will always be `generic_sensor`.
Example: generic_sensor
type
string
Type of data generated by the source. Currently it will always be `generic_sensor`.
Example: generic_sensor
format
enum SourceFormat
Example: scalar

Response codes

CodeMeaningDescription
201CreatedThe request has been fulfilled and a new resource was created.
400Bad RequestServer received an invalid request body or invalid query parameters.
404Not FoundThe requested resource does not exist or you do not have permissions to perform this action on it.

Request example

curl -X POST 'https://api.emogg.com/v1/sessions/:sessionId/events' \
-H 'Authorization: Bearer YOUR_API_TOKEN'
-H 'Content-Type: application/json'
-d '{"name":"string","format":"scalar"}'

Example response

{
"id": "eff2e60e-36c1-411f-bd7c-a3ebba93933f",
"name": "My Heartband",
"device": "generic_sensor",
"type": "generic_sensor",
"format": "scalar"
}