As part of version 4 of the Bronto API, we have added the ability to programatically manage your account. This is especially useful for agency and groups accounts that are bringing new client accounts online and want to minimize the amount of manual intervention. We have already discussed how to add new accounts, but what good is an account without users? Prior to version 4 of the API, you had to login to the Bronto web app in order to view or add users(logins). So let’s take a look at the new functions that allow you to manage your users.
As is standard, we have included create, read, update, and delete functions for logins. We have also made an effort to make the objects that are accessible through the API very closely mirror their web application counterparts. In other words, creating a contact, message, account, login, etc through the API should feel very similar to creating one in the application.
The quickest way to get a sense for an object and its parameters is to read one or more that have already been created. So check out the readLogins function and give it a try with an empty filter. Here’s an example SOAP request/response generated from soapui:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v4="http://api.bronto.com/v4">
<soapenv:Header>
<v4:sessionHeader>
<sessionId>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</sessionId>
</v4:sessionHeader>
</soapenv:Header>
<soapenv:Body>
<v4:readLogins>
<filter>
</filter>
<pageNumber>1</pageNumber>
</v4:readLogins>
</soapenv:Body>
</soapenv:Envelope>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:readLoginsResponse xmlns:ns2="http://api.bronto.com/v4">
<return>
<username>xxxxxxxxx</username>
<password>xxxxxxxxx</password>
<contactInformation>
<firstName>my</firstName>
<lastName>name</lastName>
<email>my@email.address</email>
<phone>1234567890</phone>
<country>US</country>
</contactInformation>
<permissionAgencyAdmin>false</permissionAgencyAdmin>
<permissionAdmin>false</permissionAdmin>
<permissionApi>true</permissionApi>
<permissionUpgrade>false</permissionUpgrade>
<permissionFatigueOverride>false</permissionFatigueOverride>
<permissionMessageCompose>true</permissionMessageCompose>
<permissionMessageApprove>false</permissionMessageApprove>
<permissionMessageDelete>false</permissionMessageDelete>
<permissionAutomatorCompose>false</permissionAutomatorCompose>
<permissionListCreatSend>true</permissionListCreatSend>
<permissionListCreate>false</permissionListCreate>
<permissionSegmentCreate>true</permissionSegmentCreate>
<permissionFieldCreate>true</permissionFieldCreate>
<permissionFieldReorder>false</permissionFieldReorder>
<permissionSubscriberCreate>true</permissionSubscriberCreate>
<permissionSubscriberView>true</permissionSubscriberView>
</return>
</ns2:readLoginsResponse>
</soap:Body>
</soap:Envelope>
All of the permissions should look familiar if you have had a chance to edit a user’s permissions in the application. Hence, when you create a login object through the API, you can specify those same permissions. Here is what the SOAP request for the addLogins function looks like.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v4="http://api.bronto.com/v4">
<soapenv:Header>
<v4:sessionHeader>
<sessionId></sessionId>
</v4:sessionHeader>
</soapenv:Header>
<soapenv:Body>
<v4:addLogins>
<accounts>
<username></username>
<password></password>
<contactInformation>
<organization></organization>
<firstName></firstName>
<lastName></lastName>
<email></email>
<phone></phone>
<address></address>
<address2></address2>
<city></city>
<state></state>
<zip></zip>
<country></country>
<notes></notes>
</contactInformation>
<permissionAgencyAdmin></permissionAgencyAdmin>
<permissionAdmin></permissionAdmin>
<permissionApi></permissionApi>
<permissionUpgrade></permissionUpgrade>
<permissionFatigueOverride></permissionFatigueOverride>
<permissionMessageCompose></permissionMessageCompose>
<permissionMessageApprove></permissionMessageApprove>
<permissionMessageDelete></permissionMessageDelete>
<permissionAutomatorCompose></permissionAutomatorCompose>
<permissionListCreatSend></permissionListCreatSend>
<permissionListCreate></permissionListCreate>
<permissionSegmentCreate></permissionSegmentCreate>
<permissionFieldCreate></permissionFieldCreate>
<permissionFieldReorder></permissionFieldReorder>
<permissionSubscriberCreate></permissionSubscriberCreate>
<permissionSubscriberView></permissionSubscriberView>
</accounts>
</v4:addLogins>
</soapenv:Body>
</soapenv:Envelope>
With these new functions in hand, you will be able to automate the management of your account, whereas previously this was only possible by logging into the Bronto web application. We hope you find them useful and welcome any feedback.
Alex Durzy
Support Engineer at Bronto
Related posts:
- Token, Token, Who Wants a Token? Another new feature of version 4 of the Bronto API...
- Clear that List using the API v4 Last fall, Alex explained how to Clear Contacts From...
- Create a Header Without Logging into Bronto Did you know you can now create headers and footers...
{ 1 trackback }
{ 0 comments… add one now }