MAPI Manual

NAME

LOGIN

FUNCTION

User login

SYNOPSIS

action: LOGIN
login_name
login_passwd
device_id

DESCRIPTION

This function allows users to log into the system.

Required Parameters

* action: LOGIN.
* login_name: the login name. The value must be an email address.
* login_passwd: the login password.

Optional Parameters

* device_id: a unique ID of the device generated by the user. If provided, it can be used as a token to authenticate users.

RETURN DATA

The response contains the following attributes:
* user_id: the user ID.
* session_id: the session ID.
* org_id: ID of the organization that the user belongs to.
* role: specifies the role of the logged-in user, such as "manager", "admin", "accountmanager" or "root". This field will be used later for authorization purposes.
* language: a number representing the language of the system for the user, e.g., "1" representing English.
* login_name: login name.
* user_theme: the theme of the system for the user.
* timezone: time zone of the user.

ROLE PERMITTED

All roles

EXAMPLES

The following example shows a successful HTTP GET request and response.

Request:

http://app02.yvntech.com/MapIHttpS/MapIS?action=LOGIN&login_name=name@example.com&login_passwd=1111&device_id=sampleid

Response:

<result tftype='1' infotype='0' requestid='LOGIN'>
    <field name='user_id'>6009000</field>
    <field name='session_id'>5538:172.31.28.208:20140627121025:name@example.com</field>
    <field name='org_id'>9000</field>
    <field name='role'>manager</field>
    <field name='language'>1</field>
    <field name='login_name'>name@example.com</field>
    <field name='user_theme'></field>
    <field name='timezone'>+10:00</field>
</result>

TIPS

device_id can be empty; if not empty, user can use it as a key to perform transaction without username,password and session ID; if device_id='MCPRESERVEDWS_use_sessionid_as_deviceid_END', MCP will use session ID as device ID.

ENVIRONMENT

AUTHOR

YVN Tech

SEE ALSO

CHECKIN

Mweb v2.0 YVNTECH 2014