Create user session
Create Casambi user (site account) session identified by email & password, requires use of API key (Header: X-Casambi-Key).
note
- Note that user session works only with site user credentials. If you don't know what site user is then you should use network session instead.
- After 3 failed logins user has to wait one minute to try to login again. When trying to login during this wait time server will respond with status code: Forbidden 403.
HTTP Request:
POST https://door.casambi.com/v1/users/session
Request Body:
{
"email": "name@address.com",
"password": "password"
}
CURL Example:
curl -X POST "https://door.casambi.com/v1/users/session" \
-H "Content-Type: application/json" \
-H "X-Casambi-Key:API-KEY-HERE" \
-d "{\"email\":\"EMAIL-HERE\",\"password\":\"PASSWORD-HERE\"}"
Response Example
{
"sessionId": "hJK65SenmlL2354y.P822D76HufewNSloo780PvU-78DwdmnMA8exzIo9.mmNWD23whEqbPOsl11hjjWo03___",
"sites": {
"Rg5alx4BF41lSU2jK4r7T0Q7X0i00mQ": {
"name": "Playground",
"address": "",
"role": "ADMIN",
"networks": {
"VcrTwqLZJ26UYMXxTClmpfZxELcrPUAa": {
"id": "VcrTwqLZJ26UYMXxTClmpfZxELcrPUAa",
"address": "a00f251f77cc",
"name": "Dev Network",
"type": "OPEN",
"grade": "EVOLUTION",
"role": "ADMIN"
}
}
}
},
"networks": {
"VcrTwqLZJ26UYMXxTClmpfZxELcrPUAa": {
"id": "VcrTwqLZJ26UYMXxTClmpfZxELcrPUAa",
"address": "a00f251f77cc",
"name": "Dev Network",
"type": "OPEN",
"grade": "EVOLUTION",
"role": "ADMIN"
}
}
}
note
Notice the "sessionId" and each "id" (networkId) of "networks" and "sites/networks" data within response data. These are needed in almost all further API requests.