users.getSessionToken

Syntax

mixed users.getSessionToken ( int vhost, mixed userId, bool isUserName = false, bool returnUserInfo = false, bool uploadToken = false )

Argument Info

NameTypeRequiredDefault valueDescription
vhostintRequirednoneThe id of the vhost.
userIdmixedRequirednoneThe user id that you are attempting to get the session for.
isUserNameboolOptionalfalseIf this argument is true, the method will treat the user ID argument as username.
returnUserInfoboolOptionalfalseIf this parameter is true it will return user info in an array as listed below
uploadTokenboolOptionalfalseIf this parameter is 1 a temporary generated upload only token will be generated, otherwise default sessionToken will be returned, if returnUserInfo is true you will receive both tokens.

Response: Optionally returned array

This is the data array that could potentially be returned if returnUserInfo is set to true

NameTypeDescription
idINTThe user id for the username/email provided.
userSTRINGThe username for the account requested.
vhostINTThe vhost for the account requested.
firstnameSTRINGThe first name for the account requested.
lastnameSTRINGThe last name for the account requested.
nicknameSTRINGThe nickname for the account requested.
address1STRINGThe first line of the address for the account requested.
address2STRINGThe second line of the address for the account requested.
citySTRINGThe city for the account requested.
stateSTRINGThe state/province for the account requested.
countrySTRINGThe country for the requested account.
postalSTRINGThe postal code or zip code for the requested account.
emailSTRINGThe e-mail address for the requested account.
websiteSTRINGThe website for the requested account.
genderCHARThe gender of the requested account owner, obviously this is only going to be M for male or F for female.
phoneSTRINGThe phone number for the requested account owner.
cellphoneSTRINGThe cell phone number for the requested account owner.
occupationSTRINGThe occupation for the requested account owner.
metaARRAYAn array containing any meta data that was provided by the account owner that has been saved by the system.
newsletterBOOLWhether or not the account owner wanted the newsletter or not. 1 is true, 0 is false.

Return Values

FieldDescriptionPossible Values