Subscribers – managing many subscribers within one request

Methods described below are used for the execution of the same actions as in case of managing individual subscribers, but here, up to 100 subscribers can be sent at the same time.

Method adds many subscribers in case they were not included on subscriber list or updates their states and data if their states were not "Active" nor "To be activated". In case of adding only several addresses (e.g. one address is incorrect), code 200 and data concerning incorrect address/addresses will be returned.

Recall:

POST /rest/subscriber/addMultiple

 

Data in POST:

subscribers Required Table with e-mail addresses and custom fields in the following form:

{"email" : "email_address",

"custom_fields":

{ "personalization tag 1" : "value",

"personalization tag 1" : "value" }

}

”Custom_fields” fields is optional.

list Required Hash of subscriber list
state Optional State to be assigned to a subscriber. If this field is empty, "To be activated" state will be assigned. List of available states is included in "Subscriber state codes" section.
confirm Optional CSend confirmation e-mail to the subscriber? Possible values are 0 and 1. If the field is empty, confirmation e-mail will be sent. Field is ignored (e-mail will not be sent) if subscriber's state is other than "To be activated".

 

Example of request:

{"list":"id_hash",
"subscribers" : [ {"email":"tester1@freshmail.com",
"custom_fields":{"name":"Jess",
"promotion code":"abcde"} },
{"email":"tester2@freshmail.com",
"custom_fields":{"name":"Sophie",
"promotion code":"efgh"} },
{"email":"tester3@freshmail.com",
"custom_fields":{"name":"Elisabeth",
"promotion code":"wxyz"} } ]}

Kody błędów:

1331 No subscriber was added/updated
1332 Subscriber list does not exist or no hash
1335 Incorrect state was assigned to the subscriber
1336 No email addresses were set to be added
1399 Too many subscribers within one request – limit: 100

Example of partial errors, sent request:

{"list":"4zcnmd2ski",
"subscribers":[{"email":"correct@address.email.com"},
{"email":"incorrect email address"}]}

Returned data (response code: 200):

{"status":"OK",
"data":{
"inserted":1,
"not_inserted":1,
"errors":[{"email":"Email address not correct",
"error":"Email address not correct",
"code":1301}]}}

Error codes returned for particular subscribers are the same as error codes for /rest/subscriber/add method.

Modifying data of many subscribers

Method updates state and data of many subscribers

Recall:

POST /rest/subscriber/editMultiple

Data in POST:

subscribers Required

able with e-mail addresses and custom fields in the following form

{"email" : "adres_emaiil",

"custom_fields":

{ "Personalization tag 1" : "value",

"Personalization tag 1" : "value" }

}

”Custom_fields” nie jest obiwiązkowe.

list Required Hash of subscriber list
state Optional State to be assigned to the subscriber. If this field is empty, current subscriber's state will remain unchanged.

 

Error codes:

1331 No subscriber was added/updated
1332 L1332 Subscriber list does not exist or no hash
1335 Incorrect state was assigned to the subscriber
1336 1336 No e-mail addresses were set to be updated
1399 Too many subscribers within one request – limit: 100

Returned error data/information are the same as for /rest/subscriber/addMultiple method

Downloading data concerning many subscribers

In case when a request is partially incorrect (e.g. some addresses do not exist) or incorrect (e.g. none of e-mail addresses exist), code 200 and data concerning incorrect address/addresses will be returned.

Recall:

POST /rest/subscriber/updateFieldValue

Data in GET:

listHash Required

Hash of subscription list

tag Required

Custom field tag (np. promotion_code)

value Required

Value that will be set for custom field for all subscribers

url Required

The web address where an answer will be sent after the end of update

 

Returned data:

  id Process ID

Error codes:

1381 Custom field doesn't exist
1382 No list's hash or custom field tag missing
1383 Incorrect URL address
1384 Too many characters in the "value" field - up to 255
1385 The "value" field is required
1386 The custom field updating in progress, please wait

Example of partial errors, sent request:

{"status":"ERROR",
"errors":[{
"message":"Incorrect URL address",
"code":1383
}]}