Creates or updates a contact identified by its external ID and optionally triggers a double opt-in (doi) process. Note that none of the attributes is required, however, the body needs to provide a XML representation of the contact, in the easiest case an contact with only the ID given: <contact><email>max..mustermann@xqueue.com</email></contact>.
Note: This method returns 409 (Conflict) if there are more then one contacts with the given external ID. In this case it is not possible to properly identify the contact any more. Change or remove them by identifying them with the unique Maileon ID or, if possible, by email.
1 |
POST https://api.maileon.com/1.0/contacts/externalid/:value |
Attributes
/
Parameter | Default | Description |
permission | 1 | Specifies the initial permission to be assigned to the contact.Please note: this is the initial permission that is assigned to the contact as soon as it is created. If a double-opt-in process is triggered, the permission is changed to DOI or DOI+ after the contact used the acknowledgement link in the DOI mailing. If the same contact is registered again after already acknowledging the DOI link (and thus, already has Permission 4 or 5) and you call this method with any other permission then 4 or 5 (less valuable), the permission will be ignored, since you already own a valid DOI(+) permission. Further, if Permission 4 or 5 is already set and the account is set up not to send DOI mailings if there is already a DOI permission, no DOI mailing is triggered when creating the contact a second time. Supported values: |
sync_mode | 2 | Specifies the synchronization option in case a contact with the provided email address already exists.
Supported values: |
src | A string intended to describe the source of the contact. If provided, the string will be stored with the doi process. | |
subscription_page | In case where this method was called by a subscription page, this string offers the possibility to keep track of it for use in reports. | |
doi | false | Tells whether a double opt-in process should be started for the created contact. Note that the status code returned for this request does not mean that the doi process succeeded. Supported values are true and false. |
doiplus | false | This parameter is ignored if doi is not provided or false. In case the doi process succeeds, Maileon will be allowed to track opens and clicks of the contact. |
doimailing | This parameter is ignored if doi is not provided or false. References the doi mailing to be used. If not provided, the default doi mailing will be used. |
Example
POST https://api.maileon.com/1.0/contacts/externalid/baf52l?permission=1&sync_mode=2&doi=true&doiplus=true Authorization: Basic XXXXXXXXXXXXXXX Content-Type: application/vnd.maileon.api+xml; charset=utf-8 <contact> <!— Note that the email address is required here! --> <email>max.mustermann@xqueue.com</email> <standard_fields> <field> <name>LASTNAME</name> <value>Mustermann</value> </field> <field> <name>FIRSTNAME</name> <value>Max</value> </field> </standard_fields> <custom_fields> <field> <name>COLOR</name> <value>BLUE</value> </field> </custom_fields> </contact>