login (Start the session)

The login transaction starts a session and must precede all other transactions.

Query string

The query string in the HTTP header must contain the following parameters:

api
Specify the name of the API transaction.
apiversion
Specify the version of the API that should handle the requested transaction.

For the most up-to-date version, use apiversion=3.

uid
Specify a valid 1010data user name.
pswd
Specify a valid unencrypted 1010data password for the 1010data user name provided to the uid parameter.

The response from the login transaction will provide an encrypted password, which must be supplied as the value for the pswd attribute for all the other transactions.

kill (optional)
Valid values for kill are as follows:
yes
Terminate the existing session and start a new one.
no
Do not terminate the existing session.

If no session exists, a new one will be created. If a session does exist, an error is returned.

Note: If kill=no and a session is active, the system returns an error.
possess
Log in and possess the existing session.
auth
Authenticate with the system but do not kill, possess, or start any session.

The default is yes.

XML input to server

No XML input is required. All data for the transaction is specified in the connection string.

XML response from server

The session ID and encrypted password are used in subsequent transactions. If the login is not successful, only the return code and error message are returned. A successful result contains the following elements:

<rc>
The return code generated by the transaction. For a list of return codes, see Return codes.
<sid>
The session ID assigned to the current session.
<pswd>
The encrypted password for the current session.
<msg>
The message returned by the system. Specific messages correspond to specific return codes.
<version>
Contains the version of 1010data that the session is logged in to.

Query string example

https://www2.1010data.com/gw.k?api=login&apiversion=3&uid=$UID&pswd=$PSWD

XML response example

<out>
    <rc>0</rc>
    <sid>[SESSION_ID]</sid>
    <pswd>[ENCRYPTED_PSWD]</pswd>
    <msg>Last login was: [DATETIME]</msg>
    <version>[1010data_VERSION]</version>
</out>