MAPI Manual

NAME

ADD_CONTACT

FUNCTION

Add a contact to a contact book

SYNOPSIS

contactbook_id, data_format, contact_data

DESCRIPTION

This function allows users to add a contact to a contact book.

Required Parameters

* action: ADD_CONTACT.
* contactbook_id: ID of the contact book.
* data_format: specifies how the contact data is represented. Value is either "record_type" or "url_type". Default is "record_type".

Optional Parameters

* contact_data: data for the new contact. If the data format is "record_type", the value of this parameter consists of Tab-separated values. The first value specifies the name of contact. The second one specifies the mobile number, and needs to be preceded with a '+' plus sign and country code, e.g., +61400000000. The last one specifies the email. If the data format is "url_type", the value of this parameter is made up of key-value pairs concatenated by "&" ampersand. The key is a number representing the contact column ID, and its value needs to be URL encoded. For example, "1=simon&2=%2B61400000000&3=simon%40example.com", within this value, "1" represents contact name, "2" represents mobile number and "3" represents email. Please note that the whole value of contact_data also needs to be URL encoded.

RETURN DATA

The response contains the following attribute:
* mcp_contact_id: ID of the newly added contact.

ROLE PERMITTED

Manager

EXAMPLES

The following example shows a successful HTTP GET request and response with data_format set to "record_type".

Request:
http://app02.yvntech.com/MapIHttpS/MapIS?action=ADD_CONTACT&contactbook_id=1&data_format=record_type&contact_data=jack%09%2B61422222222%09jack%40example.com&login_name=user@example.com&login_passwd=1111

Response:
<result tftype='1' infotype='0'>
    <field name='mcp_contact_id'>1159</field>
</result>

The following example shows a successful HTTP GET requests with data_format set to "url_type".

Request with contact_data parameter:
http://app02.yvntech.com/MapIHttpS/MapIS?action=ADD_CONTACT&contactbook_id=1&data_format=url_type&contact_data=1%3Djimmy%262%3D%252B61433333333%263%3Djimmy%40example.com&login_name=user@example.com&login_passwd=1111

TIPS

ENVIRONMENT

AUTHOR

YVN Tech

SEE ALSO

ADD_CONTACT_TOCONTACTGROUP

Mweb v2.0 YVNTECH 2014