getUserById

@GET(value = "users/{userID}")
abstract suspend fun getUserById(@Path(value = "userID") userID: String, @Query(value = "excludeAlerts") excludeAlerts: Boolean? = null): Response<UserResponseDto>

Retrieve account information This allows you to retrieve the account information for a user. The userID can be either the Sensibill specific userID or can be \"me\", which will return the user object for the user who is authenticated with the access token.

Accounts on the system can be in one of two states - registered or unregistered. For most normal purposes, you will deal only with registered accounts, such as those you create using the registration endpoint. However, it is possible for an account to be on our system, but unregistered. This can happen if we receive a document from a POS system for a user that is not yet on our system.

This endpoint accepts both user tokens and client tokens.

When using a user token, you are only allowed to retrieve the account information for the user associated with the access token you supply.

You can only use a client token with this endpoint if that has been explicitly enabled on your account. Please contact the Sensibill team in order to have this policy enabled on your account - it is disabled by default. When you request User information using a client token, only a limited number of fields will be returned. Responses:

  • 200: Success. The information for the user account was retrieved and returned.

  • 400: Bad Request. This will occur if you omit a required parameter, or if you provide an invalid value for a required parameter.

  • 401: Unauthorized. This will occur if you do not supply an access-token to this endpoint, or if you provide an expired or invalid access token.

  • 403: Forbidden. This will occur if the access-token you have provided is not authorized to retrieve the information for the user you have requested. This can also occur if you attempt to use a client token with this endpoint.

  • 404: Not Found. The userID you have provided is invalid. It should be either \"me\" or a valid userID.

Return

UserResponseDto

Parameters

userID

A unique ID that identifies this user in the Sensibill system. It can be 'me' to reference the user associated with the access token.

excludeAlerts

With this flag set to true, the alerts for the user are omitted. You can retrieve the counts and objects for alerts using the /users/:userID/counts endpoint. (optional)