Adds recipients to an offline event.
Post
/API/Rest/OfflineEvents/Recipients/Add
| offlineEvent | Name of the offline event |
| columns | An array of column names that match with the defined column names for this offline event. |
| data | An array of arrays of data. Each row should have an entry for each of the columns defined above. |
PopulateOfflineEvent
No Permission
Invalid offline event
Must provide some columns
Must provide some data
One not-null column was not provided in the input file, so the file cannot be loaded. The missing column is:
Several not-null columns were not provided in the input file, so the file cannot be loaded. The missing columns are:
Row has too few columns
Column doesn't exist in the offline event table.
For row with email address , column is null but the field is configured to require a value.
For the row with email address , column '' with value '' is too long for the database field. This entire row will be not be imported.
Invalid column type for column
For row with recipient identifier , unable to parse value '' for column ''. This will prevent this row from being imported.
Email address was not found in the database.
Skipping entry that already exists in the table for recipient
A database issue prevented the import of the row with email address
An unknown issue prevented the import of the row with email address
Too many API calls
Database error
Unknown error
"Success", or an array of messages, one entry for ever error encountered.
["Email address abe@example.com was not found in the database.",
"Email address rob@aol.com was not found in the database."]
Adds recipients to an offline event.
using System;
using System.Net.Http;
using System.Text;
string url = "https://example.com/API/Rest/OfflineEvents/Recipients/Add";
string message = "{\"accountName\":\"acme\",\"login\":\"ApiUser\",\"password\":\"YOUR_PASSWORD\",\"offlineEvent\":\"Shopping cart abandonment\",\"columns\":[\"EmailAddress\",\"SKU\",\"Price\",\"Quantity\",\"Product Link\"],\"data\":[[\"joe@aol.com\",\"abc123\",\"$55.00\",\"2\",\"http://www.dgsdfgsd.com\"],[\"rob@aol.com\",\"ddd111\",\"$123.12\",\" 3\",\"http://www.www.com\"]]}";
// Reuse HttpClient for multiple requests in production code.
using (var client = new HttpClient())
using (var request = new HttpRequestMessage(HttpMethod.Post, url))
{
request.Content = new StringContent(message, Encoding.UTF8, "application/json");
using (HttpResponseMessage response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
# encoding: utf-8
require 'rest-client'
require 'json'
url = 'https://example.com/API/Rest/OfflineEvents/Recipients/Add'
args = {'accountName'=>'acme', 'login'=>'ApiUser', 'password'=>'YOUR_PASSWORD', 'offlineEvent'=>'Shopping cart abandonment', 'columns'=>['EmailAddress','SKU','Price','Quantity','Product Link'], 'data'=>[['joe@aol.com','abc123','$55.00','2','http://www.dgsdfgsd.com'], ['rob@aol.com','ddd111','$123.12','3','http://www.www.com']]}
response = RestClient.post(url, args.to_json, :content_type => "application/json;charset=utf-8")
puts response
import requests
url = "https://example.com/API/Rest/OfflineEvents/Recipients/Add"
args = {'accountName':'acme','login':'ApiUser', 'password':'YOUR_PASSWORD', 'offlineEvent':'Shopping cart abandonment', 'columns':['EmailAddress','SKU','Price','Quantity','Product Link'], 'data':[['joe@aol.com','abc123','$55.00','2','http://www.dgsdfgsd.com'], ['rob@aol.com','ddd111','$123.12','3','http://www.www.com']]}
headers = {'Content-Type': 'application/json'}
resp = requests.post(url, json=args, headers=headers)
if resp.status_code == 200:
print(resp.text)
curl --request POST --header "Content-Type: application/json" --data '{"accountName":"acme","login":"ApiUser", "password":"YOUR_PASSWORD", "offlineEvent":"Shopping cart abandonment", "columns":["EmailAddress", "SKU", "Price", "Quantity", "Product Link"], "data":[["joe@aol.com", "abc123", "$55.00", "2", "http://www.dgsdfgsd.com"], ["rob@aol.com", "ddd111", "$123.12"," 3","http://www.www.com"]]}' "https://example.com/API/Rest/OfflineEvents/Recipients/Add"