UsersApi

interface UsersApi

Functions

Link copied to clipboard
@POST(value = "users")
abstract suspend fun createUser(@Body userRequestDto: UserRequestDto): Response<RegisterUserResponseDto>

Register a user This API call allows you to register a new user. To call this endpoint, you must use a client-token. You can not call this endpoint without it. Responses:

Link copied to clipboard
@DELETE(value = "users/{userID}")
abstract suspend fun deleteUser(@Path(value = "userID") userID: String, @Query(value = "export") export: Boolean? = null, @Query(value = "exportEmail") exportEmail: String? = null): Response<EmptyObjectResponseDto>

Delete user account This allows you to delete a user account. The userID can be either the Sensibill specific userID or \"me\", which will delete the user object for the user who is authenticated with the access token.
This endpoint can be used with either a client token or a user token.
When using a user token, you are only allowed to delete the account information for the user associated with the access token you supply in.
The optional export parameters may be passed as query parameters or in the request body.
In order to use this endpoint with client tokens, you must have that feature explicitly enabled on your account. It is disabled by default. Please contact the Sensibill team in order to have this enabled.
Deleting a user will also purge all documents from Sensibill's system. Responses:

Link copied to clipboard
@GET(value = "users/emailAvailability")
abstract suspend fun getEmailAvailability(@Query(value = "email") email: String): Response<EmailAvailabilityResponseDto>

Check for the availability of an email address to register a new user. This endpoint allows you to check whether a particular email address to register a new account is available or not before you register a new user.

This endpoint can be used with either a client token or a user token. Responses:

Link copied to clipboard
@GET(value = "users/receiptEmailAvailability")
abstract suspend fun getReceiptEmailAvailability(@Query(value = "email") email: String): Response<ReceiptEmailAvailabilityResponseDto>

Check for the availability of a receipt email address. This endpoint allows you to check whether a particular receipt email address to register a new account is available or not before you register a new user. If the given email address is available, then this endpoint will return back a JSON object with the property available set to true. If the email address is taken, then this endpoint will return back the property available set to false, along with a list of alternative email addresses.

This endpoint can be used with either a client token or a user token. Responses:

Link copied to clipboard
@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:

Link copied to clipboard
@GET(value = "users/usernameAvailability")
abstract suspend fun getUsernameAvailability(@Query(value = "username") username: String, @Query(value = "credentialType") credentialType: String? = null): Response<UsernameAvailabilityResponseDto>

Check for the availability of a username. This endpoint allows you to check whether a particular username to register a new account is available or not before you register a new user. If the given username is available, then this endpoint will return back a JSON object with the property available set to true. If the username is taken, then this endpoint will return back the property available set to false.

This endpoint can be used with either a client token or a user token.

In order to use this endpoint, you must have that policy explicitly enabled on your account. It is disabled by default. Please contact the Sensibill team in order to have this enabled. Responses:

Link copied to clipboard
@POST(value = "jwtRegister")
abstract suspend fun registerWithJwt(@Body jwtUserRequestDto: JwtUserRequestDto): Response<RegisterUserResponseDto>

Register a user using JWT This API call allows you to register a new user using a JSON Web Token.

Your client account must be configured to allow JWT (please reach out to the Sensibill Support Team). The API supports JWS and JWE as JWT implementations.

JWS currently supports RSA and ECDSA signing algorithms (RS256, RS384, RS512, ES256, ES384, ES512). Public keys for signature verification should be made available through a publicly accessible URL. JWS header must have ''alg'' and ''kid'' parameters and the payload must have at least ''sub'' and ''iat'' claims. The ''sub'' claim will be used as a user access ID for the user being created. If there is a desire to use another claim for those purposes then it can be configured during the client account setup. JWS implementation also supports ''exp'', ''aud'', ''iss'' and ''scp'' claims. If there is a need to validate those claims they should be configured as part of the client account setup.

JWE currently supports RSAES OAEP using default parameters (''alg'': RSA-OAEP) for encrypting the Content Encryption Key (CEK) and AES GCM using 256-bit key (''enc'': ''A256GCM'') for encrypting the content. Please reach out to the Sensibill Support Team to receive Sensibill’s public key to be used for JWT encryption. JWE’s content is expected to be a JWS conforming to the JWS requirements mentioned earlier. Responses:

Link copied to clipboard
@PUT(value = "users/{userID}")
abstract suspend fun upsertUser(@Path(value = "userID") userID: String, @Body body: UserUpdateDtoProperties): Response<EmptyObjectResponseDto>

Update account information This allows you to update the account information of a user.

This endpoint can be used with either a user token or a client token.

When using a user token, the userID can be either the Sensibill specific ID or \"me\", which will point to the user object for the user who is authenticated with the access token.

In order to use this endpoint with a client token, you must have this policy explicitly enabled on your account. It will be disabled by default. Please contact the Sensibill team if you need to have this policy enabled on your account. When using a client token, you are only allowed to change the 'status' field on a user's account. This is provided so that Clients can disable and re-enable user accounts without requiring them to log in. Responses: