MAPI Manual

NAME

ADD_CONTACT_TOCONTACTGROUP

FUNCTION

Add a contact to a contact group

SYNOPSIS

contactgroup_id, data_format, contact_data, 1...N

DESCRIPTION

This function allows users to add a contact to a contact group. The contact data can be represented in three ways.

Required Parameters

* action: ADD_CONTACT_TOCONTACTGROUP.
* contactgroup_id: ID of the contact group.
* 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.
  Note: If the data format is "url_type", the key-value pairs of the contact columns can be directly added to the request and the contact_data parameter is not required.
* 1...N: specifies the values of the contact columns when data_format is "url_type".

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_TOCONTACTGROUP&contactgroup_id=164&data_format=record_type&contact_data=simon%09%2B61422222222%09simon%40example.com&login_name=user@example.com&login_passwd=1111

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

The following examples show 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_TOCONTACTGROUP&contactgroup_id=164&data_format=url_type&contact_data=1%3Djackie%262%3D%252B61433333333%263%3Djackie%40example.com&login_name=user@example.com&login_passwd=1111

Request without contact_data parameter:
http://app02.yvntech.com/MapIHttpS/MapIS?action=ADD_CONTACT_TOCONTACTGROUP&contactgroup_id=164&data_format=url_type&1=peter&2=%2B61411111111&3=peter%40example.com&login_name=user@example.com&login_passwd=1111

TIPS

ENVIRONMENT

AUTHOR

YVN Tech

SEE ALSO

LIST_CONTACTGROUP_COLUMNS

Mweb v2.0 YVNTECH 2014