Register source
Register a device for sending custom data using the Custom events endpoint.
URL
POST /v1/sessions/:sessionId/events
Request URL Parameters
| Parameter | Description |
|---|---|
| :sessionId | ID of the session to add events. |
Request Body
name
string
Required
Name to identify the source.
format
enum SourceFormat
Required
Possible enum values
textText type data.
scalarSingle numeric value data.
Response Body
Registered device
id
string
ID of the registered device.
Example:
eff2e60e-36c1-411f-bd7c-a3ebba93933fname
string
Name of the device.
Example:
My Heartbanddevice
string
Type of device this source belongs to. Currently it will always be `generic_sensor`.
Example:
generic_sensortype
string
Type of data generated by the source. Currently it will always be `generic_sensor`.
Example:
generic_sensorformat
enum SourceFormat
Example:
scalarResponse codes
| Code | Meaning | Description |
|---|---|---|
| 201 | Created | The request has been fulfilled and a new resource was created. |
| 400 | Bad Request | Server received an invalid request body or invalid query parameters. |
| 404 | Not Found | The 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"
}