REST API for Unica Campaign offers

Description

APIs for offers in Unica Campaign.

Methods

post: /v1/offers
Creates one or more offers using the specified parameters. All of the offers are created in the specified folder using the specified template. If a folder is not specified, the root folder is used. Offers are created in the default partition (the partition for which the user is created).

Parameters

securityPolicy (optional)
Form Parameter — Security policy for new offers to be created. If not defined, the Global policy is used.
folderid (optional)
Form Parameter — ID of the folder where offers will be created. An exception is thrown if the ID is not valid.
templateName (required)
Form Parameter — Name of existing offer template to be used for new offers that are created.
BulkOfferInfo (required)
Form Parameter — Bulk offer JSON. You can include the following fields:
  • offerName: Name of offer to be created.
  • attributes: An array of attribute types that indicate the offer attributes.

Return type

array[BulkOfferInfoResponse]

Example result

Content-Type: application/json
[ {
  "reference" : {
    "componentTypeEnum" : "",
    "id" : 123456789
  },
  "offerCode" : "aeiou",
  "name" : "aeiou",
  "description" : "aeiou",
  "error" : ""
} ]

post: /v1/offers/delete
Deletes one or more existing offers.

Parameters

offerids (required)
Form Parameter — IDs of the offers to be deleted.

Return type

array[Long]

Example result

Content-Type: application/json
[ 123456789 ]

get: /v1/offers/gencode
Generates one or more unique offer codes.

Parameters

offerName (optional)
Query Parameter — OfferName for which offercodes need to be generated.
templateid (optional)
Query Parameter — Template Id

Return type

array[String]

Example result

Content-Type: application/json
[ "aeiou" ]

post: /v1/offers/getoffers
Lists all offer objects. Specify one or more offer IDs to retrieve only those offers.

Parameters

offerids (required)
Form Parameter — Returns the Unica Campaign object having these offerIds.

Return type

array[OfferInfo]

Example result

Content-Type: application/json
[ {
  "reference" : {
    "componentTypeEnum" : "",
    "id" : 123456789
  },
  "offerCode" : "aeiou",
  "name" : "aeiou",
  "description" : "aeiou",
  "attributes" : "",
  "retired" : true
} ]

post: /v1/offers/retire
Retires one or more offers.

Parameters

offerids (optional)
Form Parameter — OfferIds of the offers to be retired.

Return type

String

Example result

Content-Type: application/json
"aeiou"

post: /v1/offers/templates
Returns a list with offer template details for the requested templates.

Parameters

templateIds (optional)
Form Parameter — List of template IDs.

Return type

array[OfferTemplateDetails]

Example result

Content-Type: application/json
[ {
  "reference" : {
    "componentTypeEnum" : "",
    "id" : 123456789
  },
  "name" : "aeiou",
  "description" : "aeiou",
  "attributes" : "",
  "offerTemplateID" : 123456789
} ]

post: /v1/offers/validate
Validates a list of offers and returns validation information for each. Validation consists of checking to see whether only one matching offer exists in the database. The OfferValidationInfo object contains an error message instead of Offer Info if zero offers match the given code or name. An error is also returned instead of a match if the given code or name matches multiple offers. The list is returned in the same order as given. Offer codes and names are validated based on exact match with offers.

Parameters

offerCodeOrName (optional)
Form Parameter — Offer codes or names.

Return type

array[OfferValidationInfo]

Example result

Content-Type: application/json
[ {
  "reference" : {
    "componentTypeEnum" : "",
    "id" : 123456789
  },
  "code" : "aeiou",
  "errorMessage" : "aeiou",
  "name" : "aeiou",
  "errorCode" : "aeiou"
} ]

Return types

OfferTemplateDetails

attributes
Map[string,IAttribute]
name
String
description
String
reference
Reference
offerTemplateID
Long

Reference

componentTypeEnum
ComponentTypeEnum - An enumerated type that indicates the component type the ID is for.
id
Long

BulkOfferInfoResponse

Indicates the status of bulk offer creation
reference
Reference - Null if offer creation fails.
name
String
description
String
offerCode
String - Null if offer creation fails.
error
Exception

OfferValidationInfo

reference
Reference
errorCode
String - If not null, defines the alphanumeric validate error code.
errorMessage
String - Message that describes the error (if one occurred).
code
String - Validated offer code.
name
String - Validated offer name.

OfferInfo

reference
Reference
name
String - Not guaranteed unique.
description
String
offerCode
String - Not guaranteed unique.
attributes
Map[string,IAttribute]
retired
Boolean