Automated List Upload

Description

The Automated List Upload interface is used to both CREATE , REPLACE and APPEND lists within the platform. This is a two-part-request, with the META request followed by the DATA request Resource Location .../interface/list_upload_meta.php .../interface/list_upload_data.php Base URL https://response.pure360.com/ HTTP Method POST

Data Parameters : List Upload Meta

key value usage
profileName
"profileName"
Profile name to manipulate the list in
listName
"Master+List"
List name either new, or existing. Unique.
languageCode
"en_GB.ISO8859-15"
Language of the list must be enabled on the profile e.g. en_GB.ISO8859-15 (optional with profile default assumed)
transactionType
"CREATE"
CREATE | APPEND | REPLACE
emailCol
0
During a CREATE / REPLACE this value referes to the email column index in the CSV file (optional if mobileCol provided)
During an APPEND the email address MUST be in column 0 of the CSV file
mobileCol
1
mobile column index (optional if emailCol provided)
responseType
"EMAIL"
EMAIL | HTTP | REST : How to send the list upload completion notification
responseUri
"test@test.com"
The address to send the notification to, either email address or URI.
If IGNORE is given as the responseType it is recommended to use a string value such as 'FALSE', 'NULL' or 'NONE' as the value for maintainability purposes
COL_field1
2
During a CREATE / REPLACE the field1 is the name to give the custom data field in the contact list, the value is the index of this field both in the CSV and the custom data field index in the contact list.
During an APPEND the field1 refers to the existing custom data field name in the contact list, and the value refers to the custom data field index in the contact list. Therefore the field order in the CSV file uploaded (during the data request) MUST be in the order for the APPEND that they were during the CREATE.
token
"d82c69cd7a21a2c569db960b528d7ae53e6b45748fe2237a4f146fcd80a4fd56"
Security Token authentication (enabled within the platform via my account -> edit details -> enable -> generate)(optional)

Response

type code content : string
Success 200 OK : Integer (Where the integer is the transactionID used in the data upload
Error 200 Error : Error Message

Data Parameters : List Upload Data

key value usage
profileName
"profileName"
Profile name to manipulate the list in
transactionId
454565
The transactionId returned from list_upload_meta
file
"@//usr/FilePath/file.csv"
valid CSV file (list) to upload

Response

type code content : string
Success 200 OK : Integer (Where the integer is the transactionID used in the data upload
Error 200 Error : Error Message

Example - Curl Sending Meta Data

curl
--data "profileName=TestProfile&listName=NewList&transactionType=CREATE&emailCol=0&responseType=EMAIL&responseUri=test@pure360.com&COL_first_name=1" 'https://response.pure360.com/interface/list_upload_meta.php'
Send a request to the list upload meta processor, in this case adding the NewList to the profile TestProfile, and CREATEing it, the first column of the CSV that will get sent across contains the email address and the next column contains the first name. When the list upload process completes, a notification EMAIL is sent to test@pure360.com. If this has processed correctly the response should be OK : XXXX where XXXX is a transactionId.

Example - Curl Sending List Data

curl
--form "profileName=TestProfile"
--form "transactionId=XXXX"
--form "file=@//usr/FilePath/file.csv"
'https://response.pure360.com/interface/list_upload_data.php'
Send a request to the list upload data processor, in this case sending the file in usr/FilePath/file.csv to profile TestProfile and reference the container for this as the XXXX transaction ID returned from the meta request.

APPEND

  1. You must provide a COL_ for every single field in the target list.
  2. Each COL_ must appear in the post in the same order as they do in the list.
  3. Each COL_ must have an index number
  4. The index number does not have to match a column from the csv file
  5. If the index number does not exist, then that column will not have any values appened.

Example APPENDs

Example 1: csv structure matches list

Target list csv Field mapping in post
  • Email (system field)
  • firstname
  • lastname
  • postcode
two@pure360.com,Davey,Jones,DJ1 2PR
three@pure360.com,Mikey,Moose,MM1 8PL

File has 4 columns:
email, first name, last name, postcode; which is the same columns and order as the target list

emailCol=0
COL_firstname=1
COL_lastname=2
COL_postcode=3

Example 2: csv in different order

Target list csv Field mapping in post
  • Email (system field)
  • firstname
  • lastname
  • postcode
two@pure360.com,Davey,DJ1 2PR,Jones
three@pure360.com,Mikey,MM1 8PL,Moose

File has 4 columns:
email, first name, postcode, last name; which is a different order to the list: post code should be at the end.

emailCol=0
COL_firstname=1
COL_lastname=3
COL_postcode=2

Example 3: csv with headers and empty fields

Target list csv Field mapping in post
  • Email (system field)
  • firstname
  • lastname
  • postcode
email,first-name,last-name,post-code
two@pure360.com,Davey,,DJ1 2PR
three@pure360.com,Mikey,,MM1 8PL

File has 4 columns:
email, first name, last name, postcode; which is the same order to the list. Apart from the header row none of the rows have a value for last name.

emailCol=0
COL_firstname=1
COL_lastname=2
COL_postcode=3

Example 4: csv with less columns than the list

Target list csv Field mapping in post
  • Email (system field)
  • firstname
  • lastname
  • postcode
email,postcode
two@pure360.com,DJ1 2PR
three@pure360.com,MM1 8PL

File has 2 columns: email and post code

emailCol=0
COL_firstname=999
COL_lastname=998
COL_postcode=1

Each COL_ is listed in order, non-existent column numbers have been mapped for the list fields which are not present in the list


Example 5: 10 field list with values only for the 1st and the 10th

Target list csv Field mapping in post
  • Email (system field)
  • firstname
  • lastname
  • postcode
  • lastPurchaseDate
  • 12monthSpend
  • 12monthPurchases
  • 3monthSpend
  • 3monthPurchases
  • emailPreferences
  • abandonOptout
email,abandon
one@pure360.com,y

File has 2 columns: email, abandon.

emailCol=0
COL_firstname=999
COL_lastname=998
COL_postcode=997
COL_lastPurchaseDate=996
COL_12monthSpend=995
COL_12monthPurchases=994
COL_3monthSpend=993
COL_3monthPurchases=992
COL_emailPreferences=991
COL_abandonOptout=1

Each COL_ in the list is listed in order, non-existent column numbers have been mapped for the list fields which are not present in the list


Example curls

Meta

curl --location --request POST 'https://response.pure360.com/interface/list_upload_meta.php' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'profileName=myProfile' \
--data-urlencode 'listName=autolistTest1' \
--data-urlencode 'transactionType=APPEND' \
--data-urlencode 'emailCol=0' \
--data-urlencode 'responseType=EMAIL' \
--data-urlencode 'responseUri=myEmail' \
--data-urlencode 'token=[upload token from profile]' \
--data-urlencode 'COL_1=1' \
--data-urlencode 'COL_2=99' \
--data-urlencode 'COL_3=3' \
--data-urlencode 'COL_4=2'

Data

curl --location --request POST 'https://response.pure360.com/interface/list_upload_data.php' \
--form 'profileName="myProfile"' \
--form 'transactionId="[transactionId from Meta]"' \
--form 'file=@"/Users/me/Data/file.csv"'