User login (User.Login)

Description

Logins the user. This command must be executed before any other API command in order to perform the login and create the user session.

Input Parameters

Command=User.Login [required]
This parameter defines the API command to run. It should be equal to User.Login.
ResponseFormat [optional] [default=XML]
Defines the response data format. It can be equal to XML or JSON .
Username [required]
Your Sendloop account username.
Password [required]
Your Sendloop account password.
APIKey [required]
Your Sendloop account API key.

Output Parameters

Success [true or false]
If an error has occurred, this parameter will be equal to false. Otherwise it will be set to true.
ErrorCode [integer]
If an error has occurred, this parameter will contain error codes. Otherwise it will be set to 0.
SessionID [string]
If login was successful, this parameter will contain the session ID that you will need on your following API calls.
UserInfo [array]
This array contains the information related to the logged in user.

Error Codes

#1
Username is missing
#2
Password is missing
#3
API key is missing
#4
Incorrect username or password. Login failed.
#9998
Unauthorized access. User login required to execute this API call.
#9999
Invalid API call. Please check the API command and try again.

Example

Request:

curl http://acme.sendloop.com/api/v2/Command=User.Login&
APIKey=239ce66c239kdb7d52f1216fda4bf3a23id392&Username=acmeuser&
Password=acmepass&ResponseFormat=XML

Response:

<?xml version="1.0" encoding="utf-8"?>
<response>
    <Success><![CDATA[1]]></Success>
    <ErrorCode>
        <subnode_0><![CDATA[0]]></subnode_0>
    </ErrorCode>
    <SessionID><![CDATA[759ekrt4efgolvtnqifboi7b00]]></SessionID>
    <UserInfo>
        <Subdomain><![CDATA[acme]]></Subdomain>
        <MemberSince><![CDATA[2008-01-15 15:26:52]]></MemberSince>
        <FirstName><![CDATA[John]]></FirstName>
        <LastName><![CDATA[Blair]]></LastName>
        <Email><![CDATA[john@acme.com]]></Email>
        <CompanyName><![CDATA[Acme Co.]]></CompanyName>
        <Website><![CDATA[acme.com]]></Website>
        <Street><![CDATA[Acme Street]]></Street>
        <City><![CDATA[Acme City]]></City>
        <State><![CDATA[--]]></State>
        <Zip><![CDATA[20398]]></Zip>
        <Country><![CDATA[US]]></Country>
        <Phone><![CDATA[123456789]]></Phone>
        <Fax><![CDATA[123456789]]></Fax>
        <TimeZone><![CDATA[America/New York]]></TimeZone>
        <APIKey><![CDATA[239ce66c239kdb7d52f1216fda4bf3a23id392]]></APIKey>
        <Language><![CDATA[en]]></Language>
        <LastActivityDateTime><![CDATA[2010-01-26 13:28:37]]></LastActivityDateTime>
    </UserInfo>
</response>