Log In by Account

PUT/zstack/v1/accounts/login

Body

{
  "logInByAccount": {
    "accountName": "test",
    "password": "password",
    "captchaUuid": "39bd748906ad301793c64f688dc197a9",
    "verifyCode": "test"
  },
  "systemTags": [],
  "userTags": []
}

In the above example, the systemTags and userTags fields can be omitted. They are listed to show that these two fields can be included in the body.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"logInByAccount":{"accountName":"test","password":"password","captchaUuid":"39bd748906ad301793c64f688dc197a9","verifyCode":"test"}}' \
http://localhost:8080/zstack/v1/accounts/login

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
accountNameStringbody (contained in the logInByAccount structure)Account name 0.6
passwordStringbody (contained in the logInByAccount structure)Password 0.6
captchaUuid (optional)Stringbody (contained in the logInByAccount structure)Captcha UUID 2.6.0
verifyCode (optional)Stringbody (contained in the logInByAccount structure)Verification code 2.6.0
clientInfo (optional)Mapbody (contained in the logInByAccount structure)Client information 3.5.0
systemTags (optional)ListbodySystem tags 0.6
userTags (optional)ListbodyUser tags 0.6
accountType (optional)Stringbody (contained in the logInByAccount structure)  3.4.0

API Response

Response example

{
  "inventory": {
    "uuid": "5d77893e242d39ec8b9856a7b8762eab",
    "accountUuid": "7ab57f322e4a396b8124ed4fda810966",
    "expiredDate": "Nov 14, 2017 2:20:57 PM",
    "noSessionEvaluation": false
  }
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error0.6
inventorySessionInventoryFor details, see inventory0.6

error

NameTypeDescriptionStarting Version
codeStringThe error code number, a globally unique identifier for the error, e.g., SYS.1000, HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringThe detailed error information0.6
elaborationStringReserved field. Defaults to null0.6
opaqueLinkedHashMapReserved field. Defaults to null0.6
causeErrorCodeThe root error, the cause of the current error. This field is null if there is no root error0.6

inventory

NameTypeDescriptionStarting Version
uuidStringThe resource UUID, uniquely identifying this resource0.6
accountUuidStringAccount UUID0.6
userUuidStringUser UUID0.6
expiredDateTimestampSession expiration date0.6
createDateTimestampCreation time0.6

SDK Examples

Java SDK

LogInByAccountAction action = new LogInByAccountAction();
action.accountName = "test";
action.password = "password";
action.captchaUuid = "39bd748906ad301793c64f688dc197a9";
action.verifyCode = "test";
LogInByAccountAction.Result res = action.call();

Python SDK

LogInByAccountAction action = LogInByAccountAction()
action.accountName = "test"
action.password = "password"
action.captchaUuid = "39bd748906ad301793c64f688dc197a9"
action.verifyCode = "test"
LogInByAccountAction.Result res = action.call()