MAPI Manual

NAME

GET_CONTACTBOOK

FUNCTION

Get the definition of a contact book

SYNOPSIS

action: GET_CONTACTBOOK
contactbook_id

login_name
login_passwd
or  
login_name
session_id
or  
device_id

DESCRIPTION

This function allows users to get the definition of a contact book. A contact book contains a list of contacts, and defines the columns of the contacts. Both GET and POST methods can be used to perform the request.

Required Parameters

* action: specifies the requested function. Sets to GET_CONTACTBOOK.
* contactbook_id: ID of the contact book.

* login_name: the login name for authenticating the user.
* login_passwd: the login password for authenticating the user.
or
* login_name: the login name for authenticating the user.
* session_id: the session ID for authenticating the user.
or
* device_id: a unique ID of the device. The system can use it as a key to identify users. 

RETURN DATA

For each valid request, the server provides a response in XML format. 
The response contains the following attributes:
* mcp_org_id: organisation ID.
* mcp_contactbook_id: ID of the contact book.
* contactbook_type: type of the contact book. Types are either "org_level" or "user_level". 
* contactbook_name: name of the contact book.
* contactbook_description: description of the contact book.
* owner_mcp_user_id: ID of the user who created the contact book.
* creat_dt: the timestamp when the contact book was created.
* lastupdate_mcp_user_id: ID of the user who last updated the contact book.
* last_update_dt: the timestamp when the last update was made to the contact book.
* mcp_contactbook_columns: contains the column definitions.

For an invalid request, the response XML contains the following attribute:
* msg: a string containing the error message. 

ROLE PERMITTED

EXAMPLES

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

Request:
http://app02.yvntech.com/MapIHttpS/MapIS?action=GET_CONTACTBOOK&contactbook_id=1&device_id=demoid

Response:
<result tftype='1' infotype='0'>
    <resultset name="mcp_contactbook">
        <row>
            <field name="mcp_org_id">10000</field>
            <field name="mcp_contactbook_id">1</field>
            <field name="contactbook_type">org_level</field>
            <field name="contactbook_name">default app02 contactbook</field>
            <field name="contactbook_description">for simple app02 </field>
            <field name="owner_mcp_user_id">2010000</field>
            <field name="creat_dt">2013-05-01 06:55:32</field>
            <field name="lastupdate_mcp_user_id">2010000</field>
            <field name="last_update_dt">2013-05-01 06:55:32</field>
            <resultset name="mcp_contactbook_columns">
                <row>
                    <field name="mcp_org_id">10000</field>
                    <field name="mcp_contactbook_id">1</field>
                    <field name="mcp_contactbook_column_id">1</field>
                    <field name="screen_title">name</field>
                    <field name="mcp_datatype_id">1</field>
                    <field name="report_title">name</field>
                    <field name="field_screen_order">1</field>
                    <field name="mcp_contactbook_fixcolumn_id">1001</field>
                </row>
                <row>
                    <field name="mcp_org_id">10000</field>
                    <field name="mcp_contactbook_id">1</field>
                    <field name="mcp_contactbook_column_id">2</field>
                    <field name="screen_title">mobile</field>
                    <field name="mcp_datatype_id">9</field>
                    <field name="report_title">mobile</field>
                    <field name="field_screen_order">2</field>
                    <field name="mcp_contactbook_fixcolumn_id">1020</field>
                </row>
                <row>
                    <field name="mcp_org_id">10000</field>
                    <field name="mcp_contactbook_id">1</field>
                    <field name="mcp_contactbook_column_id">3</field>
                    <field name="screen_title">email</field>
                    <field name="mcp_datatype_id">8</field>
                    <field name="report_title">email</field>
                    <field name="field_screen_order">3</field>
                    <field name="mcp_contactbook_fixcolumn_id">1030</field>
                </row>
            </resultset>
        </row>
    </resultset>
</result>


TIPS

ENVIRONMENT

AUTHOR

YVN Tech

SEE ALSO

ADD_CONTACTBOOK

Mweb v2.0 YVNTECH 2014