API Wrappers
Taguchi’s wrappers make connecting to our API a breeze no matter what type of stack or coding language you use.
Simply find your preferred language, follow the installation instructions and connect using your API credentials.
Our wrappers are available across multiple coding languages and support all available API resources.
$connection_params = array(
"host" => "your-taguchi-host.taguchimail.com",
"organization_id" => 1,
"username" => "your-taguchi-account@example.org",
"password" => "secret"
);
$ctx = new tmapiv4\Context(
$connection_params["host"], $connection_params["username"],
$connection_params["password"], $connection_params["organization_id"]
);
/*
Create a new subscriber profile (updating the first and last name fields if
a profile with that email address already exists), and add it to the list if
the ID has been specified.
*/
$subscriber = new tmapiv4\Subscriber($ctx);
$subscriber->firstname = "John";
$subscriber->lastname = "Doe";
$subscriber->email = "john.doe@example.org";
if ($list_id) {
$subscriber->subscribe_to_list($list_id, null);
}
$subscriber->create_or_update();
Dictionary<string, string> connectionParams = new Dictionary<string, string>() {
{"host", "your-taguchi-host.taguchimail.com"},
{"organization_id", "1"},
{"username", "your-taguchi-account@example.org"},
{"password", "secret"}
};
Context ctx = new Context(connectionParams["host"], connectionParams["username"],
connectionParams["password"], connectionParams["organization_id"]);
// Create some new subscriber records, and add to a list.
Console.WriteLine("Running create test...");
Random rand = new Random();
for (int i = 0; i < 100; i++)
{
Subscriber s2 = new Subscriber(ctx);
int idx = rand.Next(1000);
s2.FirstName = "Subscriber" + idx.ToString();
s2.LastName = "Test";
s2.Email = "edmtest+" + idx.ToString() + "@taguchi.com.au";
s2.SubscribeToList(idx % 2 == 0 ? "123" : "124", null);
s2.CreateOrUpdate();
Console.WriteLine("Created subscriber " + s2.Email + " with ID " + s2.RecordId);
}
?
?