REST API for Unica Campaign offers
Description
APIs for offers in Unica Campaign.
Methods
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
Example result
Content-Type: application/json
[ {
"reference" : {
"componentTypeEnum" : "",
"id" : 123456789
},
"offerCode" : "aeiou",
"name" : "aeiou",
"description" : "aeiou",
"error" : ""
} ]
Deletes one or more existing offers.
Parameters
offerids (required)
Form Parameter — IDs of the offers to be deleted.
Return type
Example result
Content-Type: application/json
[ 123456789 ]
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
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
Example result
Content-Type: application/json
[ {
"reference" : {
"componentTypeEnum" : "",
"id" : 123456789
},
"offerCode" : "aeiou",
"name" : "aeiou",
"description" : "aeiou",
"attributes" : "",
"retired" : true
} ]
Retires one or more offers.
Parameters
offerids (optional)
Form Parameter — OfferIds of the offers to be retired.
Return type
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
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
Example result
Content-Type: application/json
[ {
"reference" : {
"componentTypeEnum" : "",
"id" : 123456789
},
"code" : "aeiou",
"errorMessage" : "aeiou",
"name" : "aeiou",
"errorCode" : "aeiou"
} ]
attributes
Map[string,IAttribute]
name
String
description
String
reference
Reference
offerTemplateID
Long
componentTypeEnum
ComponentTypeEnum - An enumerated type that indicates the component type the ID is for.
id
Long
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
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.
reference
Reference
name
String - Not guaranteed unique.
description
String
offerCode
String - Not guaranteed unique.
attributes
Map[string,IAttribute]
retired
Boolean