Package org.linphone.core

# Interface AccountManagerServices

public interface AccountManagerServices
Creates and manage SIP user accounts remotely, using the REST API of the
Flexisip Account Manager.
see: https://gitlab.linphone.org/BC/public/flexisip-account-manager

## Method Summary

Modifier and Type
Method
Description
`AccountManagerServicesRequest`
`createDeleteDeviceRequest(Address sipIdentity, AccountDevice device)`
Requests to delete a device from the list of currently known devices.
`AccountManagerServicesRequest`
`createGetAccountCreationRequestTokenRequest()`
Requests a an account creation request token that once validated using the URL
returned by this method upon success, will allow you to call `createGetAccountCreationTokenFromRequestTokenRequest(java.lang.String)`
to obtain a valid account creation token.
`AccountManagerServicesRequest`
`createGetAccountCreationTokenFromRequestTokenRequest(String requestToken)`
Converts an account creation request token obtained by
linphone_account_manager_services_request_account_creation_request_token to an
account creation token.
`AccountManagerServicesRequest`
`createGetDevicesListRequest(Address sipIdentity)`
Requests the list of devices currently known.
`AccountManagerServicesRequest`
`createLinkEmailToAccountUsingCodeRequest(Address sipIdentity, String code)`
Validates the link between an email address and an account using a code
received by email after calling `createSendEmailLinkingCodeByEmailRequest(org.linphone.core.Address, java.lang.String)`
`AccountManagerServicesRequest`
`createLinkPhoneNumberToAccountUsingCodeRequest(Address sipIdentity, String code)`
Validates the link between a phone number and an account using a code received
by SMS after calling `createSendPhoneNumberLinkingCodeBySmsRequest(org.linphone.core.Address, java.lang.String)`
`AccountManagerServicesRequest`
`createNewAccountUsingTokenRequest(String username, String password, String algorithm, String token)`
Creates an account using an account creation token, for example obtained using
`createSendAccountCreationTokenByPushRequest(java.lang.String, java.lang.String, java.lang.String)`.
`AccountManagerServicesRequest`
`createSendAccountCreationTokenByPushRequest(String pnProvider, String pnParam, String pnPrid)`
Requests a push notification to be sent to device, containing a valid account
creation token.
`AccountManagerServicesRequest`
`createSendEmailLinkingCodeByEmailRequest(Address sipIdentity, String emailAddress)`
Requests a code to be sent to a given email address, that can be used later to
associate said email to an account using `createLinkEmailToAccountUsingCodeRequest(org.linphone.core.Address, java.lang.String)`
.
`AccountManagerServicesRequest`
`createSendPhoneNumberLinkingCodeBySmsRequest(Address sipIdentity, String phoneNumber)`
Requests a code to be sent to a given phone number, that can be used later to
associate said phone number to an account using `createLinkPhoneNumberToAccountUsingCodeRequest(org.linphone.core.Address, java.lang.String)`
.
`String`
`getLanguage()`
Gets the configurer preferred language, if set.
`long`
`getNativePointer()`
Gets the native pointer used by this class to make native method calls.
`Object`
`getUserData()`
Gets the object stored in this object user's data
`void`
`setLanguage(String language)`
Sets the preferred language to get error messages from account manager (if
supported, otherwise will be english).
`void`
`setUserData(Object data)`
Sets the object to store in this object user's data
`String`
`toString()`

## Method Details

### getLanguage

@Nullable String getLanguage()
Gets the configurer preferred language, if set.

Returns:
  the language previously set, if any (otherwise null).

### setLanguage

void setLanguage(@Nullable String language)
Sets the preferred language to get error messages from account manager (if
supported, otherwise will be english).

Parameters:
  `language` - The language (en, fr, etc...) you'd like to have error messages
  in (if possible).

### createDeleteDeviceRequest

@NonNull AccountManagerServicesRequest createDeleteDeviceRequest(@NonNull Address sipIdentity, @NonNull AccountDevice device)
Requests to delete a device from the list of currently known devices.

Parameters:
  `sipIdentity` - the SIP identity URI that identifies your account for which
  you want the devices list.
  `device` - the `AccountDevice` to delete.
Returns:
  the `AccountManagerServicesRequest` request object.

### createGetAccountCreationRequestTokenRequest

@NonNull AccountManagerServicesRequest createGetAccountCreationRequestTokenRequest()
Requests a an account creation request token that once validated using the URL
returned by this method upon success, will allow you to call `createGetAccountCreationTokenFromRequestTokenRequest(java.lang.String)`
to obtain a valid account creation token.
Once the account creation token is obtained, you can call `createNewAccountUsingTokenRequest(java.lang.String, java.lang.String, java.lang.String, java.lang.String)`
.

Returns:
  the `AccountManagerServicesRequest` request object.

### createGetAccountCreationTokenFromRequestTokenRequest

@NonNull AccountManagerServicesRequest createGetAccountCreationTokenFromRequestTokenRequest(@NonNull String requestToken)
Converts an account creation request token obtained by
linphone_account_manager_services_request_account_creation_request_token to an
account creation token.
The obtained token can be used to call `createNewAccountUsingTokenRequest(java.lang.String, java.lang.String, java.lang.String, java.lang.String)`
.

Parameters:
  `requestToken` - the token obtained previously and validated using your web
  browser.
Returns:
  the `AccountManagerServicesRequest` request object.

### createGetDevicesListRequest

@NonNull AccountManagerServicesRequest createGetDevicesListRequest(@NonNull Address sipIdentity)
Requests the list of devices currently known.

Parameters:
  `sipIdentity` - the SIP identity URI that identifies your account for which
  you want the devices list.
Returns:
  the `AccountManagerServicesRequest` request object.

### createLinkEmailToAccountUsingCodeRequest

@NonNull AccountManagerServicesRequest createLinkEmailToAccountUsingCodeRequest(@NonNull Address sipIdentity, @NonNull String code)
Validates the link between an email address and an account using a code
received by email after calling `createSendEmailLinkingCodeByEmailRequest(org.linphone.core.Address, java.lang.String)`

Parameters:
  `sipIdentity` - the SIP identity URI that identifies the account to which
  you want to link the email address to.
  `code` - the code received by email.
Returns:
  the `AccountManagerServicesRequest` request object.

### createLinkPhoneNumberToAccountUsingCodeRequest

@NonNull AccountManagerServicesRequest createLinkPhoneNumberToAccountUsingCodeRequest(@NonNull Address sipIdentity, @NonNull String code)
Validates the link between a phone number and an account using a code received
by SMS after calling `createSendPhoneNumberLinkingCodeBySmsRequest(org.linphone.core.Address, java.lang.String)`

Parameters:
  `sipIdentity` - the SIP identity URI that identifies the account to which
  you want to link the phone number to.
  `code` - the code received by SMS.
Returns:
  the `AccountManagerServicesRequest` request object.

### createNewAccountUsingTokenRequest

@NonNull AccountManagerServicesRequest createNewAccountUsingTokenRequest(@NonNull String username, @NonNull String password, @NonNull String algorithm, @NonNull String token)
Creates an account using an account creation token, for example obtained using
`createSendAccountCreationTokenByPushRequest(java.lang.String, java.lang.String, java.lang.String)`.

Parameters:
  `username` - the username of the newly created account.
  `password` - the password to use for the newly created account.
  `algorithm` - the algorithm to use to hash the password (must be either MD5
  or SHA-256).
  `token` - the account creation token obtained previously.
Returns:
  the `AccountManagerServicesRequest` request object.

### createSendAccountCreationTokenByPushRequest

@NonNull AccountManagerServicesRequest createSendAccountCreationTokenByPushRequest(@NonNull String pnProvider, @NonNull String pnParam, @NonNull String pnPrid)
Requests a push notification to be sent to device, containing a valid account
creation token.
Provider, param & prid can be obtained from `Core.getPushNotificationConfig()`
, but on iOS may need some modifications (depending on debug mode for example).
Once the token is obtained, you can call `createNewAccountUsingTokenRequest(java.lang.String, java.lang.String, java.lang.String, java.lang.String)`
.

Parameters:
  `pnProvider` - The provider, for example "apns.dev".
  `pnParam` - The parameters, for example
  "ABCD1234.org.linphone.phone.remote".
  `pnPrid` - The prid, also known as push token.
Returns:
  the `AccountManagerServicesRequest` request object.

### createSendEmailLinkingCodeByEmailRequest

@NonNull AccountManagerServicesRequest createSendEmailLinkingCodeByEmailRequest(@NonNull Address sipIdentity, @NonNull String emailAddress)
Requests a code to be sent to a given email address, that can be used later to
associate said email to an account using `createLinkEmailToAccountUsingCodeRequest(org.linphone.core.Address, java.lang.String)`
.

Parameters:
  `sipIdentity` - the SIP identity URI that identifies the account to which
  you want to link the email address to.
  `emailAddress` - the email address to which to send the code to.
Returns:
  the `AccountManagerServicesRequest` request object.

### createSendPhoneNumberLinkingCodeBySmsRequest

@NonNull AccountManagerServicesRequest createSendPhoneNumberLinkingCodeBySmsRequest(@NonNull Address sipIdentity, @NonNull String phoneNumber)
Requests a code to be sent to a given phone number, that can be used later to
associate said phone number to an account using `createLinkPhoneNumberToAccountUsingCodeRequest(org.linphone.core.Address, java.lang.String)`
.

Parameters:
  `sipIdentity` - the SIP identity URI that identifies the account to which
  you want to link the phone number to.
  `phoneNumber` - the phone number to which to send the code by SMS.
Returns:
  the `AccountManagerServicesRequest` request object.

### setUserData

void setUserData(Object data)
Sets the object to store in this object user's data

Parameters:
  `data` - the object to store

### getUserData

Object getUserData()
Gets the object stored in this object user's data

Returns:
  the object store if any, null otherwise

### getNativePointer

long getNativePointer()
Gets the native pointer used by this class to make native method calls.

Returns:
  the nativer pointer, as long

### toString

String toString()

Overrides:
  `toString` in class `Object`