REST API for campaigns in Unica Campaign

Description

APIs for campaign objects in Campaign.

Methods

get: /v1/campaigns
getCampaigns Returns the list of Campaign objects in the form of JSON data.
The list of campaign objects is not filtered. For a filtered list of campaigns, use POST /Campaign/rest/v1/campaigns/search.

Parameters

code (optional)
Query Parameter — Returns the campaign object defined by specified campaign code.
folderId (optional)
Query Parameter — Identifier of the folder where the campaigns reside.
sort (optional)
Query Parameter — Order for sorting the returned campaign objects. Use \"-\" before the parameter to sort the column in descending order or \"%2B\" to sort in ascending order.

Return type

array[CampaignInfo]

Example result

Content-Type: application/json
[ {
  "initiative" : "aeiou",
  "creatorFlag" : "aeiou",
  "endDate" : "",
  "createdByUser" : "aeiou",
  "description" : "aeiou",
  "lastRunDate" : "",
  "createByUserId" : 123456789,
  "securityPolicy" : "aeiou",
  "reference" : {
    "componentTypeEnum" : "",
    "id" : 123456789
  },
  "name" : "aeiou",
  "objectives" : "aeiou",
  "attributes" : [ {
    "metadata" : {
      "componentTypeEnum" : "",
      "allowAddOptions" : true,
      "internal" : true,
      "hidden" : true,
      "displayName" : "aeiou",
      "parametric" : true,
      "displayOrder" : 123,
      "description" : "aeiou",
      "mandatory" : true,
      "required" : true,
      "typeEnum" : "",
      "statusEnum" : "",
      "array" : true,
      "generated" : true,
      "name" : "aeiou",
      "nullAllowed" : true,
      "id" : 123456789,
      "selectTypeEnum" : "",
      "systemDefined" : true,
      "accessTypeEnum" : "",
      "applicationTypeEnum" : ""
    },
    "name" : "aeiou",
    "valueAsObject" : "",
    "valuesAsObjects" : [ "" ]
  } ],
  "id" : 123456789,
  "projectID" : 123456789,
  "startDate" : "",
  "campaignCode" : "aeiou",
  "createDate" : {
    "firstDayOfWeek" : 123,
    "minimalDaysInFirstWeek" : 123,
    "timeZone" : {
      "displayName" : "aeiou",
      "rawOffset" : 123,
      "dSTSavings" : 123,
      "iD" : "aeiou"
    },
    "time" : "2015-07-20T11:09:33.725+0000",
    "timeInMillis" : 123456789,
    "lenient" : true
  }
} ]

post: /v1/campaigns
createCampaign Creates a campaign with the provided JSON data.

Parameters

folderid (optional)
Form Parameter — Identifier of the folder in which to create the campaign.
campaign (required)
Form Parameter — Campaign object data in JSON format.

Return type

String

Example result

Content-Type: application/json
"aeiou"

get: /v1/campaigns/code
generateCampaignCode Generates a Campaign code.

Parameters

Return type

String

Example result

Content-Type: application/json
"aeiou"

post: /v1/campaigns/delete
deleteCampaigns Deletes the specified campaigns.
This action deletes a set of campaigns. To delete a single campaign, use DELETE /Campaign/rest/v1/campaigns/{campaignid}.

Parameters

campaignids (required)
Form Parameter — List of identifiers of the campaigns to be deleted, in the form of campaignids=x&campaignids=y.

Return type

String

Example result

Content-Type: application/json
"aeiou"

get: /v1/campaigns/metrics
getCampaignMetrics Returns the metrics for the specified campaign.
The metrics include the total contacts and the response counts.

Parameters

campaignid (required)
Query Parameter — Identifier of the campaign for which to return metrics.

Return type

MetricsInfo

Example result

Content-Type: application/json
{
  "totalContacts" : 123456789,
  "reponseMetrics" : [ {
    "responseCount" : 123456789,
    "responseCode" : "aeiou"
  } ]
}

post: /v1/campaigns/search
searchCampaign Search for campaigns based on the provided information.
The search can be performed on attribute values that are part of the campaign information. Limit the search based on the pageoffset and pagesize parameters.

Parameters

pageoffset (required)
Form Parameter — Starting offset of all possible campaigns to begin the enumeration (zero-valued).
pagesize (required)
Form Parameter — Maximum number of matched campaigns to return for each page (cannot exceed 500).
campaign (optional)
Form Parameter — CampaignInfo object data, in JSON format, to be searched within the available campaign objects.
folderId (optional)
Form Parameter — Restrict the search within the specified folder.

Return type

array[CampaignInfo]

Example result

Content-Type: application/json
[ {
  "initiative" : "aeiou",
  "creatorFlag" : "aeiou",
  "endDate" : "",
  "createdByUser" : "aeiou",
  "description" : "aeiou",
  "lastRunDate" : "",
  "createByUserId" : 123456789,
  "securityPolicy" : "aeiou",
  "reference" : {
    "componentTypeEnum" : "",
    "id" : 123456789
  },
  "name" : "aeiou",
  "objectives" : "aeiou",
  "attributes" : [ {
    "metadata" : {
      "componentTypeEnum" : "",
      "allowAddOptions" : true,
      "internal" : true,
      "hidden" : true,
      "displayName" : "aeiou",
      "parametric" : true,
      "displayOrder" : 123,
      "description" : "aeiou",
      "mandatory" : true,
      "required" : true,
      "typeEnum" : "",
      "statusEnum" : "",
      "array" : true,
      "generated" : true,
      "name" : "aeiou",
      "nullAllowed" : true,
      "id" : 123456789,
      "selectTypeEnum" : "",
      "systemDefined" : true,
      "accessTypeEnum" : "",
      "applicationTypeEnum" : ""
    },
    "name" : "aeiou",
    "valueAsObject" : "",
    "valuesAsObjects" : [ "" ]
  } ],
  "id" : 123456789,
  "projectID" : 123456789,
  "startDate" : "",
  "campaignCode" : "aeiou",
  "createDate" : {
    "firstDayOfWeek" : 123,
    "minimalDaysInFirstWeek" : 123,
    "timeZone" : {
      "displayName" : "aeiou",
      "rawOffset" : 123,
      "dSTSavings" : 123,
      "iD" : "aeiou"
    },
    "time" : "2015-07-20T11:09:33.824+0000",
    "timeInMillis" : 123456789,
    "lenient" : true
  }
} ]

get: /v1/campaigns/{campaignid}
getCampaign Returns the specified campaign object.

Parameters

campaignid (required)
Path Parameter — Identifier of the campaign object to be returned.

Return type

CampaignInfo

Example result

Content-Type: application/json
{
  "initiative" : "aeiou",
  "creatorFlag" : "aeiou",
  "endDate" : "",
  "createdByUser" : "aeiou",
  "description" : "aeiou",
  "lastRunDate" : "",
  "createByUserId" : 123456789,
  "securityPolicy" : "aeiou",
  "reference" : {
    "componentTypeEnum" : "",
    "id" : 123456789
  },
  "name" : "aeiou",
  "objectives" : "aeiou",
  "attributes" : [ {
    "metadata" : {
      "componentTypeEnum" : "",
      "allowAddOptions" : true,
      "internal" : true,
      "hidden" : true,
      "displayName" : "aeiou",
      "parametric" : true,
      "displayOrder" : 123,
      "description" : "aeiou",
      "mandatory" : true,
      "required" : true,
      "typeEnum" : "",
      "statusEnum" : "",
      "array" : true,
      "generated" : true,
      "name" : "aeiou",
      "nullAllowed" : true,
      "id" : 123456789,
      "selectTypeEnum" : "",
      "systemDefined" : true,
      "accessTypeEnum" : "",
      "applicationTypeEnum" : ""
    },
    "name" : "aeiou",
    "valueAsObject" : "",
    "valuesAsObjects" : [ "" ]
  } ],
  "id" : 123456789,
  "projectID" : 123456789,
  "startDate" : "",
  "campaignCode" : "aeiou",
  "createDate" : {
    "firstDayOfWeek" : 123,
    "minimalDaysInFirstWeek" : 123,
    "timeZone" : {
      "displayName" : "aeiou",
      "rawOffset" : 123,
      "dSTSavings" : 123,
      "iD" : "aeiou"
    },
    "time" : "2015-07-20T11:09:33.828+0000",
    "timeInMillis" : 123456789,
    "lenient" : true
  }
}

put: /v1/campaigns/{campaignid}
updateCampaign Updates the specified campaign object.

Parameters

campaignid (required)
Path Parameter — Identifier of the campaign to be updated.
body (required)
Body Parameter — Information, in the form the JSON data, to update in the specified campaign object. Only mutable fields are accepted.

Return type

String

Example result

Content-Type: application/json
"aeiou"

delete: /v1/campaigns/{campaignid}
deleteCampaign Deletes the specified campaign object.
This action deletes a single campaign. To delete multiple campaigns, use POST /Campaign/rest/v1/campaigns/delete with a list of CampaignIDs.

Parameters

campaignid (required)
Path Parameter — Identifier of the campaign object to be deleted.

Return type

String

Example result

Content-Type: application/json
"aeiou"

Return types

MetricsInfo

totalContacts
Long
reponseMetrics
array[ResponseMetrics]

TimeZone

displayName
String
rawOffset
Integer
dSTSavings
Integer
iD
String

IAttributeMetadata

array
Boolean
name
String
id
Long
hidden
Boolean
displayName
String
description
String
internal
Boolean
required
Boolean
mandatory
Boolean
generated
Boolean
systemDefined
Boolean
componentTypeEnum
ComponentTypeEnum
nullAllowed
Boolean
typeEnum
AttributeTypeEnum
statusEnum
AttributeStatusEnum
accessTypeEnum
AccessTypeEnum
selectTypeEnum
SelectTypeEnum
applicationTypeEnum
ApplicationTypeEnum
parametric
Boolean
allowAddOptions
Boolean
displayOrder
Integer

Reference

componentTypeEnum
ComponentTypeEnum
id
Long

Calendar

lenient
Boolean
firstDayOfWeek
Integer
minimalDaysInFirstWeek
Integer
time
Date
timeZone
TimeZone
timeInMillis
Long

ResponseMetrics

responseCode
String
responseCount
Long

IAttribute

name
String
metadata
IAttributeMetadata
valueAsObject
Object
valuesAsObjects
array[Object]

CampaignInfo

securityPolicy
String
reference
Reference
name
String
description
String
campaignCode
String
createByUserId
Long
createDate
Calendar
endDate
Calendar
initiative
String
startDate
Calendar
objectives
String
creatorFlag
String
projectID
Long
attributes
array[IAttribute]
id
Long
createdByUser
String
lastRunDate
Calendar