POST/v1/devices/{device_id}:assign
Assign a keypad device
Puts a keypad device on a customer's lane, by the customer's external ID and an optional product, and answers the codes that set its days to the lane's paid-up time and payment terms, in the order they are entered. Without a customer, takes it off its lane. A lane another keypad holds is DEVICE_LANE_TAKEN, and a retired keypad is DEVICE_RETIRED. Needs customers:write.
curl -X POST 'https://api.entitler.co/v1/devices/<device_id>:assign' \
-H "Authorization: Bearer $ENTITLER_KEY" \
-H "Content-Type: application/json" \
-d '{"customerExternalId":"customerExternalId","productId":"productId","target":{"environmentId":"environmentId","projectId":"projectId","teamId":"teamId"}}'Credentials
Send any one of these:
- Bearer token
Path parameters
| Name | Type | Description |
|---|---|---|
device_idrequired | string |
Request body
object
customerExternalIdstringproductIdstringtargetProductTargetenvironmentIdstringprojectIdstringteamIdstring
Responses
200The AssignDeviceResponse message.
AssignDeviceResponse
codesarray of DeviceCoderequiredcodestringrequiredcountinteger (int64)requiredat least 0; at most 4294967295
daysinteger (int64)requiredat least 0; at most 4294967295
deviceIdstringrequiredissuedAtintegerrequiredat least 0; at most 18446744073709552000
kindDeviceCodeKindrequiredOne of
DEVICE_CODE_KIND_UNSPECIFIED,DEVICE_CODE_KIND_ADD_DAYS,DEVICE_CODE_KIND_SET_DAYS,DEVICE_CODE_KIND_UNLOCK.
deviceKeypadDeviceassignedAtintegerat least 0; at most 18446744073709552000
customerExternalIdstringdigitsKeypadDigitsrequiredOne of
KEYPAD_DIGITS_UNSPECIFIED,KEYPAD_DIGITS_FULL,KEYPAD_DIGITS_RESTRICTED.externalIdstringrequiredidstringrequiredproductIdstringregisteredAtintegerrequiredat least 0; at most 18446744073709552000
retiredAtintegerat least 0; at most 18446744073709552000
ErrorA refusal, with the HTTP status of its gRPC code.
Error
errorobjectrequiredcodestringrequiredparametersobjectrequiredEach value: string
reasonstringor nullrequired