Authenticate an account
Цей контент ще не доступний вашою мовою.
authAccount checks the self-care portal credentials of an account of the authenticated customer and returns the account’s ID. Use it to log your users in on your own website or app with the same login and password as in the portal.
The method supports trusted mode with i_customer, the customer that owns the account.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
username |
string | one of | Web login of the account |
email |
string | one of | email of the account, used instead of username |
password |
string | yes | Web password, or a one-time password from resetAccountOneTimePassword |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
i_account |
int | ID of the authenticated account |
Example
Section titled “Example”call("authAccount", {"username": "1001", "password": "kq7Rm2xVt9Lp"}){"result": "OK", "i_account": 3092}A login with a one-time password succeeds with a fault, so handle code 410 separately:
import xmlrpc.client
try: i_account = call("authAccount", {"username": "1001", "password": otp})["i_account"]except xmlrpc.client.Fault as f: if f.faultCode == 410: ask_for_new_password() # logged in with a one-time password else: raiseErrors
Section titled “Errors”| faultCode | faultString | Cause |
|---|---|---|
410 |
Not an error: the account was authenticated with a one-time password. Ask the user to set a new password | |
More than one account matched |
Several accounts have this email. Log in with username instead |
Related
Section titled “Related”- Reset the one-time password of an account
- Get account information
- Authenticate customers
- Authenticate an account by login and password:
authAccountFly, for accounts of all customers - Accounts: Account Name and Web Password