WS_MailUpSend.GetFields
DEPRECATED METHOD
The response of GetFields method is different from many other MailUpSend methods because it includes "errorCode" only when call is not successful. If this inconsistency is critical for your client application you can use GetFields_st method instead. GetFields_st is the recommended choice if you are starting a new integration with MailUp.
Method parameters
GetFields allows to retrieve the user personal data fields which have been configured in the MailUp system. This feature is useful when using applications that, in order to integrate, necessarily need to map their data structure based on MailUp personal data fields. Mapping is a one-time, preliminary operation for configuring data import to MailUp.
- string GetFields(stringaccessKey)
- accessKey: access key obtained using the LoginFromId method
The method returns a string in XML format containing the names and IDs of the personal data fields.
Sample GetFields response
<GetFields> <Fields> <Field Name="nome" Id ="X"/> .... </Fields> </ GetFields >
The XML string will have the following features:
- A root node <GetFields>.
- A node <Fields>, contained in the root node.
- A series of nodes <Field> for each configured personal data field, contained in the node <Fields>. Nodes <Field> have the attributes Name and Id. The first contains the name of the personal data field, the second contains the identifier.
In case no personal data field has been configured, the node <Fields> will be empty (without nodes <Field>) in the XML string
In case of errors during the request, the XML string will have the following structure:
<GetFields> <Error>"Messaggio di errore"</Error> </GetFields>
The XML string will have the following features:
- A root node <GetFields>.
- A node <Error>, contained in the root node, returning the error message.
More sample GetFields response for the above described scenarios:
- Values returned: MailUp personal data fields and the corresponding IDs are listed. IDs are requested when importing to MailUp
<GetFields> <Fields> <Field Name="email" Id ="111"/> <Field Name="cognome" Id ="2"/> <Field Name="nome" Id ="3"/> <Field Name="Data di nascita" Id ="4"/> <Field Name="Nazionalita" Id ="5"/> <Field Name="Sesso" Id ="6"/> <Field Name="Telefono" Id ="7"/> </Fields> </GetFields>
- Personal data fields have not been configured
<GetFields> <Fields> </Fields> </GetFields>
- Error message
<GetFields> <Error> "Messaggio di errore" </Error> </GetFields>