Request
/api/version
Response
{
major: 1,
minor: 1,
patch: 1
}
Returns API versions supported by this collar server
Request
GET /api/discover
Response
[1]
Used by the collar client and other API consumers to check server availability
Request
GET /api/1/
Response
{
"status": "OK"
}
Request
POST /api/1/auth/create
{
"name": "users display name",
"email": "users email address",
"password": "the users password",
"confirmPassword: "used to check the password"
}
Response
{
"profile" : {
...
},
"token" : "bearer token"
}
Request
POST /api/1/auth/login
{
"username": "username",
"password: "password",
}
Response
{
"profile" : {
...
},
"token" : "bearer token"
}
All requests must be sent with an Authorization: Bearer <token>
with a token returned by /api/1/auth/create
or /api/1/auth/login
Request
GET /api/1/profile/<profile uuid>
Response
{
"id": "profile uuid",
"name": "profiles display name"
}
Request
GET /api/1/profile/me
Response
{
"id": "profile uuid",
"name": "profiles display name",
"email": "your email"
}
Request
GET /api/1/profile/me/devices
Response
{
"profileId": "uuid of the owner",
"deviceId": "the device id",
"publicKey: {
...
}
}
Request
GET /api/1/profile/me/devices/<deviceId>
Response
{}