Security Code

Security Code

*Method:GET

  • URL:/accounts/api/security/get/

  • Basic Authentication: True

The security code will expire after 5 consecutive minutes of inactivity, and you need to obtain a new security code.

This API uses Basic Authentication to verify user identity. The following are curl and python examples:

curl

curl -i --user <user>:<pwd> http://<server_ip>:<port>/accounts/api/security/get/

python

import requests

url = 'http://<server_ip>:<port>/accounts/api/security/get/'
user = '<user>'
pwd = '<pwd>'
response = requests.get( url, auth=( user, pwd ))
print(response.text)

After verification, the following two responses will appear:

{    
    "status": 200,
    "message": "Successful.",
    "result": {
        "security": "<security code>"
        }
}
{
    "status": "500",
    "message": "The user does not exist."
}

{
    "status": "404",
    "message": "User is not enabled."
}

{
    "status": "404",
    "message": "Login failed."
}

Last updated