Java API

Introduction

This document describes how to connect to both Individual and Broadcast versions of the Java API.

  • Individual API is always located at http://domainname/automation/individual.asmx

  • Broadcast API is always located at http://domainname/automation/broadcast.asmx

 

Adding the Java API to your project

What you need to do first is to copy the .jar library inside your Java project.

After that, you need to add the .jar inside your build path.

Now, you can start creating your projects importing the correct classes:

import individual.*;

import individual.soap.*;

import broadcast.*;

Note: This library can be obtained on request.

 

Using both Webservices

To use either the Individual or the Broadcast API, you Must create a new SOAP client (Soapclient), and provide the URL of your webservice.

Functions Overview

Individual API

AddActionCode

AddActionCode (AuthHeader header, int actionListId, String code, String description)

Description: Adds a new ActionCode in a specific ActionList

Output parameters:

- String result.getErrorString()

- String result.getResultCode()

 

AddActionCodes

AddActionCodes (AuthHeader header, int actionListId, ArrayList<ActionCode> actionCodes)

Description: Adds a multiple ActionCodes in a specific ActionList

Output parameters:

- String result.getErrorString()

- String result.getResultCode()


AddRecordToActionList

AddRecordToActionList (AuthHeader header, int actionListId, ArrayList<Property> property)- String result.getResultCode()

Description: Adds a new record to an ActionList

Output parameters:

- String result.getErrorString()

- String result.getResultCode()

 

AddRecordsToActionList

AddRecordsToActionList (AuthHeader header, int actionListId, ArrayList<ArrayList<Property>> ArrayOfPropertys)

Description: Adds multiple records to an ActionList

Output parameters:

- String result.getErrorString()

- String result.getResultCode()

 

AddToSegment

AddToSegment (AuthHeader header, int segmentId, int[] ids)

Description: Adds a list of IDs to a Segment

Output parameters:

- String result.getErrorString()

- String result.getResultCode()

 

 

CountUsersByConstraint

CountUsersByConstraint (AuthHeader header, String list, String constraint)

Description: Returns the number of user from one List that pass the given constraint

Output parameters:

- int result.getUserCount()

- String result.getErrorString()

- String result.getResultCode()

 

CountUsersByFilter

CountUsersByFilter (AuthHeader header, String list, ArrayList<Property> Filter)

Description: Returns the number of user from one List that pass the given filter

Output parameters:

- int result.getUserCount()

- String result.getErrorString()

- String result.getResultCode()


CreateActionList

CreateActionList (AuthHeader header, String name, String description, ArrayList<AdditionalFields> additionaFields)

Description: Creates a new ActionList

Output parameters:

- int result.getactionListId()

- String result.getErrorString()

- String result.getResultCode()

 

 

CreateSegment

CreateSegment (AuthHeader header, int listid, String name, String description)

Description: Creates a new Segment in a given List

Output parameters:

- int result.getsegmentId()

- String result.getErrorString()

- String result.getResultCode()

 

CreateUser

CreateUser (AuthHeader header, String List, ArrayList<Property> Changes)

Description: Creates a new User in a given List

Output parameters:

- int result.getID()

- String result.getErrorString()

- String result.getResultCode()

 

GetActionCodes

GetActionCodes (AuthHeader header, int actionListID)

Description: Returns the ActionCodes given an ActionList ID

Output parameters:

- ArrayList<ActionCode> result.getActionCodes()

- String result.getErrorString()

- String result.getResultCode()

 

GetActionLists

GetActionLists (AuthHeader header)

Description: Returns all ActionLists of the platform

Output parameters:

- ArrayList<ActionList> result.getActionLists()

- String result.getErrorString()

- String result.getResultCode()

 

GetListID

GetListID (AuthHeader header, String name)

Description: Returns the ID of the list with the given name

Output parameters:

- int result.getID()

- String result.getErrorString()

- String result.getResultCode()


GetLists

GetLists (AuthHeader header, int[] lists)

Description: Returns characteristics of all Lists of the platform

Output parameters:

- ArrayList<List> result.getLists()

- String result.getErrorString()

- String result.getResultCode()

 

GetPlannedCampaigns

GetPlannedCampaigns (AuthHeader header)

Description: Returns characteristics of all planned Campaigns

Output parameters:

- ArrayList<PlannedCampaignInfo> result.getPlannedCampaignInfo()

- String result.getResultCode()

- String result.getErrorString()

 

 

GetSegmentRecordCount

GetSegmentRecordCount (AuthHeader header, int segmentId)

Description: Returns the users count from a given Segment

Output parameters:

- int result.getSegmentRecordCount()

- String result.getResultCode()

- String result.getErrorString()

 

GetSegments

GetSegments (AuthHeader header, int listId)

Description: Returns information of all the Segments from the given list

Output parameters:

- ArrayList<SegmentInfo> result.getSegmentsInfo()

- String result.getResultCode()

- String result.getErrorString()

 

GetSystemStatus

GetSegments (AuthHeader header)

Description: Returns information of the System Status

Output parameters:

- String result.getResultCode()


GetUserByConstraint

GetUserByConstraint (AuthHeader header, String List, String constraint)

Description: Returns information of the User from the given list passing the given constraint

Output parameters:

- ArrayList<Property> result.getUserInfo()

- String result.getResultCode()

- String result.getErrorString()


GetUserByFilter

GetUserByFilter (AuthHeader header, String List, ArrayList<Property> Filter)

Description: Returns information of the User from the given list passing the given filter

Output parameters:

- ArrayList<Property> result.getUserInfo()

- String result.getResultCode()

- String result.getErrorString()


 

GetUserByID

GetUserByID (AuthHeader header, String List, int UserID)

Description: Returns information of the User from the given list and matching the ID

Output parameters:

- ArrayList<Property> result.getUserInfo()

- String result.getResultCode()

- String result.getErrorString()

 

GetUsersByConstraint

GetUsersByConstraint (AuthHeader header, String List, String constraint, int MaxCount)

Description: Returns the ID’s of the Users from the given list that pass the given constraint

Output parameters:

- ArrayList<Integer> result.getResultIDS()

- String result.getResultCode()

- String result.getErrorString()

 

GetUsersByFilter

GetUsersByFilter (AuthHeader header, String List, ArrayList<Property> Filter, int MaxCount)

Description: Returns the ID’s of the Users from the given list that pass the given filter

Output parameters:

- ArrayList<Integer> result.getResultIDS()

- String result.getResultCode()

- String result.getErrorString()

 

GetUsersXmlByConstraint

GetUsersXmlByConstraint (AuthHeader header, String List, String constraint)

Description: Returns the XML of the Users from the given list that pass the given constraint

Output parameters:

- String result.getXML()

- String result.getResultCode()

- String result.getErrorString()

 

RetrieveHashForUser

RetrieveHashForUser (AuthHeader header, String GateName, String List, int UserID)

Description: Returns the HashCode for a user from a given list and userid

Output parameters:

- String result.getHashCode()

- String result.getResultCode()

- String result.getErrorString()

 

TriggerCampaign

TriggerCampaign (AuthHeader header, String GateName, ArrayList<Property> InputData)

Description: Triggers a Campaign using a Gate and a filter

Output parameters:

- String result.getResultCode()

- String result.getErrorString()


TriggerCampaignByXml

TriggerCampaignByXml (AuthHeader header, String GateName, String Xml)

Description: Triggers a Campaign using a Gate and a xml

Output parameters:

- String result.getResultCode()

- String result.getErrorString()

 

TriggerCampaignForUser

TriggerCampaignForUser(AuthHeader header, String list, int UserID, String GateName, ArrayList<Property> InputData)

Description: Triggers a Campaign using a gate, a filter, a list and a userid

Output parameters:

- String result.getResultCode()

- String result.getErrorString()


TriggerCampaignForUserAndActionListItem

TriggerCampaignForUserAndActionListItem(AuthHeader header, int ListID, int ActionListID, int UserID, String GateName, String ActionCode, ArrayList<Property> ActionListItemData)

Description: Triggers a Campaign using a list, an actionlist, a userid, a gate, an actioncode and a filter

Output parameters:

- String result.getResultCode()

- String result.getErrorString()


TriggerChannel

TriggerChannel (AuthHeader header, String ChannelName, ArrayList<Property> InputData)

Description: Triggers a Channel using a channel name and a filter

Output parameters:

- String result.getResultCode()

- String result.getErrorString()

 

 

TriggerChannelForUser

TriggerChannelForUser (AuthHeader header, String list, int UserID, String ChannelName, ArrayList<Property> InputData)

Description: Triggers a Channel using a list, a userid, a channel name and a filter

Output parameters:

- String result.getResultCode()


- String result.getErrorString()

 

UpdateUser

UpdateUser (AuthHeader header, String list, int UserID, ArrayList<Property> Changes)

Description: Updates a User from a given list

Output parameters:

- String result.getResultCode()

- String result.getErrorString()


UpdateUsers

UpdateUsers (AuthHeader header, String list, ArrayList<UserChanges> changes, int mode)

Description: Updates multiple Users from a given list

Output parameters:

- String result.getResultCode()

- String result.getErrorString()


Broadcast API

CreateCampaign

CreateCampaign (AuthHeader header, String Xml)

Description: Creates a Campaign and returns the Campaign ID

Output parameters:

- int result.getCampaignID()

- String result.getResultCode()

- String result.getErrorString()

 

GetCampaignKPI

GetCampaignKPI (AuthHeader header, int campaignId)

Description: Returns the KPI of the given campaign

Output parameters:

- CampaignKPI result.getCampaignKPI()

- String result.getResultCode()

- String result.getErrorString()


SetCampaignState

SetCampaignState (AuthHeader header, int campaignId, String NewState)

Description: Changes the State of the given campaign

Output parameters:

- String result.getResultCode()

- String result.getErrorString()

 

Errors

If the method “result.getErrorString()” doesn’t give a clear response of what’s wrong with the function that’s being tried to use, there is a method “result.getSoapResponse()” that will return the entire response from the webservice.