process.env.ALLTHINGS_OAUTH_CLIENT_ID
process.env.ALLTHINGS_OAUTH_CLIENT_SECRET,
process.env.ALLTHINGS_OAUTH_PASSWORD,
process.env.ALLTHINGS_OAUTH_USERNAME,
client.createAgent()
Create a new agent. This is a convenience function around creating a user and adding that user to a property-manager's team.
const appId = '575027e58178f56a008b4568'
const propertyManagerId = '5a818c07ef5f2f00441146a2'
const username = 'mr.example@allthings.test'
const agent = await client.createAgent(appId, propertyManagerId, username, {
email: 'mr.example@allthings.test',
locale: 'en_US',
})
export type MethodCreateAgent = (
appId: string,
propertyManagerId: string,
username: string,
data: PartialUser & {
readonly email: string
readonly locale: EnumLocale
},
) => UserResult
export interface InterfaceAllthingsRestClient {
readonly delete: MethodHttpDelete
readonly get: MethodHttpGet
readonly post: MethodHttpPost
readonly patch: MethodHttpPatch
readonly agentCreate: MethodAgentCreate
readonly agentCreatePermissions: MethodAgentCreatePermissions
readonly appCreate: MethodAppCreate
readonly lookupIds: MethodLookupIds
readonly groupCreate: MethodGroupCreate
readonly groupGetById: MethodGroupGetById
readonly groupUpdateById: MethodGroupUpdateById
readonly notificationsGetByUser: MethodNotificationsGetByUser
readonly notificationsUpdateReadByUser: MethodNotificationsUpdateReadByUser
readonly notificationUpdateRead: MethodNotificationUpdateRead
readonly propertyCreate: MethodPropertyCreate
readonly propertyGetById: MethodPropertyGetById
readonly propertyUpdateById: MethodPropertyUpdateById
readonly registrationCodeCreate: MethodRegistrationCodeCreate
readonly unitCreate: MethodUnitCreate
readonly unitGetById: MethodUnitGetById
readonly unitUpdateById: MethodUnitUpdateById
readonly userCreate: MethodUserCreate
readonly userGetById: MethodUserGetById
readonly userUpdateById: MethodUserUpdateById
readonly getUsers: MethodGetUsers
readonly getCurrentUser: MethodGetCurrentUser
readonly userCreatePermission: MethodUserCreatePermission
readonly userGetPermissions: MethodUserGetPermissions
readonly userDeletePermission: MethodUserDeletePermission
readonly userGetUtilisationPeriods: MethodUserGetUtilisationPeriods
readonly userCheckInToUtilisationPeriod: MethodUserCheckInToUtilisationPeriod
readonly utilisationPeriodCreate: MethodUtilisationPeriodCreate
readonly utilisationPeriodGetById: MethodUtilisationPeriodGetById
readonly utilisationPeriodUpdateById: MethodUtilisationPeriodUpdateById
readonly utilisationPeriodCheckInUser: MethodUtilisationPeriodCheckInUser
}