Add a Column to a database
AddListColumn API is used to add new column to an existing
database.
There
are various elements used along with this API as follows:
LIST_ID : The ID of the Engage database the column is being
added to.
COLUMN_NAME : The name of the column being added.
COLUMN_TYPE : Defines what type of column to create. The
following is a list of valid values :
0 – Text
column
1 – YES/No column
2 – Numeric column
3 – Date
column
4 – Time
column
6 – Select
one
8 – Segmenting
13 – SMS Opt
In
14 – SMS Opted Out
Date
15 – SMS
Phone Number
16 – Phone
Number
17 – Timestamp
20 –
Multi-Select
/// <summary>
/// AddListColumn API is
used to add new column to an existing database.
/// </summary>
///
<param name="sessionId">Session
id.</param>
/// <param
name="listId">List id.</param>
/// <param
name="columnName">Column name.</param>
/// <returns>AddListColumn status.</returns>
private bool AddListColumn(string sessionId, long listId, string columnName)
{
EngageSoapApiClientService_InterfaceClient engage = new
EngageSoapApiClientService_InterfaceClient();
AddListColumnRequestType
addListColumnRequest = new
AddListColumnRequestType(); sessionheadertype sessionHeader = new sessionheadertype(); sessionHeader.sessionid =
sessionId;
ListMgmtUserActionsResponseType listMgmtUserActionResponse = new ListMgmtUserActionsResponseType();
addListColumnRequest.LIST_ID
= listId; addListColumnRequest.COLUMN_NAME = columnName;
addListColumnRequest.COLUMN_TYPE = 0;
listMgmtUserActionResponse
= engage.AddListColumn(sessionHeader, addListColumnRequest); return listMgmtUserActionResponse.SUCCESS;
}
No comments:
Post a Comment