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 groupFindById: MethodGroupFindById
readonly groupUpdateById: MethodGroupUpdateById
readonly propertyCreate: MethodPropertyCreate
readonly propertyFindById: MethodPropertyFindById
readonly propertyUpdateById: MethodPropertyUpdateById
readonly registrationCodeCreate: MethodRegistrationCodeCreate
readonly unitCreate: MethodUnitCreate
readonly unitFindById: MethodUnitFindById
readonly unitUpdateById: MethodUnitUpdateById
readonly userCreate: MethodUserCreate
readonly userFindById: MethodUserFindById
readonly userUpdateById: MethodUserUpdateById
readonly getUsers: MethodGetUsers
readonly getCurrentUser: MethodGetCurrentUser
readonly userCreatePermission: MethodUserCreatePermission
readonly userFindPermissions: MethodUserFindPermissions
readonly userDeletePermission: MethodUserDeletePermission
readonly userGetUtilisationPeriods: MethodUserGetUtilisationPeriods
readonly userCheckInToUtilisationPeriod: MethodUserCheckInToUtilisationPeriod
readonly utilisationPeriodCreate: MethodUtilisationPeriodCreate
readonly utilisationPeriodFindById: MethodUtilisationPeriodFindById
readonly utilisationPeriodUpdateById: MethodUtilisationPeriodUpdateById
readonly utilisationPeriodCheckInUser: MethodUtilisationPeriodCheckInUser
}