sessionId that you will use for the rest of you session.Creating a token
Some Example Code (PHP and JAVA AXIS)
Below is some example code you can use to get an idea of how to login to the new API.
PHP
/*
This example script will connect to the API and authenticate a session.
Be sure to replace the "ADD YOUR API TOKEN HERE" text with a working
API Token.
*/
ini_set("soap.wsdl_cache_enabled", "0");
date_default_timezone_set('America/New_York');
$wsdl = "https://api.bronto.com/v4?wsdl";
$url = "https://api.bronto.com/v4";
$client = new SoapClient($wsdl, array('trace' => 1, 'encoding' => 'UTF-8'));
$client->__setLocation($url);
$token = "ADD YOUR API TOKEN HERE";
$sessionId = $client->login(array("apiToken" => $token))->return;
$client->__setSoapHeaders(array(new SoapHeader("https://api.bronto.com", 'sessionId', $sessionId)));
JAVA AXIS
/**
* This example program will connect to the API and authenticate a session.
*/
package com.bronto;
import org.apache.axis.client.Stub;
import com.bronto.api.objects.BrontoSoapApi;
import com.bronto.api.objects.BrontoSoapApiImplService;
import com.bronto.api.objects.BrontoSoapApiImplServiceLocator;
import com.bronto.api.objects.StringValue;
public class TestLoginBronto {
private static final String API_TOKEN = "ADD YOUR API TOKEN HERE";
public static void main(String args[]) throws Exception {
BrontoSoapApiImplService locator = new BrontoSoapApiImplServiceLocator();
BrontoSoapApi api = locator.getBrontoSoapApiImplPort();
// Login
String sessionId = api.login(API_TOKEN);
if (sessionId == null) {
System.out.println("Login failed.");
return;
}
((Stub)api).setHeader(locator.getServiceName().getNamespaceURI(), "sessionId", sessionId);
System.out.println("Login was successful.");
}
}
Lots More
With its expanded functionality and improved design, the new API provides many exciting opportunities to integrate with your systems outside of Bronto. We hope you enjoy the new API as much as we enjoy bringing it to you.
Andrew Kanes
Support Engineer at Bronto
Related posts:
- Create a Header Without Logging into Bronto Did you know you can now create headers and footers...
- Using readDeliveries In API Version 4 In version 4 of the API, we have updated the...
- Personalize Your Contacts, Storing Field Data With The API OK, so your integration is running. You’re adding contacts at...


{ 2 trackbacks }
{ 0 comments… add one now }