Create Transaction Contacts Import
POST {{baseUrl}}/directories/:directoryId/mailinglists/:mailingListId/transactioncontacts
Import contacts into the specified mailing list - contacts can have associated transaction data.
<!--From Readme-->
To check on the status of your import use Transaction Contacts Import Status or follow the url value nested under the tracking
key in the API response.
<!-- theme: danger -->
JSON Body Size Limit
The size of the JSON body accepted by this API call is 5 MB with a maximum of 10,000 contacts per import.
The API request will return an error if the size of the body or contact count exceed the aforementioned limits.
Understanding contacts.unprocessed in the API response
This JSON array has items which are integers. Each integer represents the index of a JSON object in the API request's contacts array.
A contact can fail to process for several reasons, some of which are detailed in the below sections: *
transactionData
*embeddedData
Several other reasons include: -
transactionData
orembeddedData
are not JSON objects - Keys in thecontact
object do not adhere to their type restrictions specified.
Contact deduplication
If your organization has deduplication settings on, then any
contact
in the request body that matches an existing contact (in the directory or the specified mailing list) based on those deduplication settings will be merged with said existing contact.If the previously existing contact has a transaction associated with it, and a
contact
matching by deduplication is included in this API request body, then the existing contact will be updated. Thus, the existing contact will now have two transactions instead of one.Furthermore, any information that was previously specified or not-specified for the contact, if included in this API's request body, will also be updated for the existing contact.
transactionMeta
The transactionMeta
key is only required if transactionData
is supplied in the contact body. If supplied, it is a JSON object, and is constructed as follows:
JSON Syntax
{"fields": fields,"batchId": batchId}
As transactionMeta
"transactionMeta": {"fields": ["field1","field2"],"batchId": batchId}
fields
JSON data type: array Must have a minimum of one item in the array; there is no maximum.
All the items in this array must be JSON strings, or else the API request will return an error response.
batchId
JSON data type: string This key-value pair is required. The provided value must be a Create Transaction Batch ID.
The transaction batch associated with the provided ID must exist. If it does not exist, transactions will not be created and added.
All created transactions will be added to the specified transaction batch. You may paginate through all the transactions in a batch.
contacts
JSON data type: array Must have a minimum of one item in the array; there is no maximum.
Each item in the contacts
array for the API request must be a contact.
contact
JSON data type: object
The optional keys are:
- firstName
    (value must be a JSON string)
- lastName
    (value must be a JSON string)
- email
    (value must be a JSON string and conform to valid email format)
- embeddedData
    (see embeddedData
below)
- language
    (value must be a JSON string)
- extRef
    (value must be a JSON string)
- unsubscribed
    (value must be a JSON boolean)
- transactionData
    (see transactionData
below)
<!-- theme: info -->
Do Not Use Null
The value
null
is not a valid value for these keys. If you do not want to include one of the optional keys, then you must omit it entirely from the JSON.
transactionData
JSON data type: object
This JSON object (if supplied) must, at a minimum, have keys that match at least one of the elements seen in fields
above. If this object has keys that are not specified in transactionMeta.fields
, the extra keys are ignored. Transaction key-value pairs are solely dictated by the items in transactionMeta.fields
.
The values of the keys can be JSON strings, numbers or booleans.
embeddedData
JSON data type: object
This JSON object must have keys that do not match any of the elements seen in fields above. If this object has keys that are in transactionMeta.fields
, the contact encapsulating this JSON object is added to contacts.unprocessed
array in the API response.
The values of the keys can be JSON strings, numbers or booleans.
Request Body
{"contacts"=>[{"firstName"=>"<string>", "lastName"=>"<string>", "email"=>"<string>", "extRef"=>"<string>", "embeddedData"=>{"Excepteur4"=>"<string>", "eiusmod_e"=>"<string>", "culpa813"=>"<string>"}, "language"=>"<string>", "unsubscribed"=>"<boolean>", "transactionData"=>{"nulla33"=>28395320.399390206, "Lorem_9"=>"et laboris labore"}}, {"firstName"=>"<string>", "lastName"=>"<string>", "email"=>"<string>", "extRef"=>"<string>", "embeddedData"=>{"sunt_3b3"=>"<string>", "dolorb0"=>"<string>", "incididunt_f7f"=>"<string>"}, "language"=>"<string>", "unsubscribed"=>"<boolean>", "transactionData"=>{"veniam54"=>"consequat Excepteur Lorem magna"}}], "transactionMeta"=>{"batchId"=>"<string>", "fields"=>["<string>"]}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
Accept | string |