Unica Campaign is an advanced campaign management solution that brings with it the powerful segmentation capabilities of outbound, multi-channel, multi-wave batch campaign execution, and tracking. But how does everything operate in the background, how does the Campaign connect or integrate with the other products in the suite? There is a restful approach of doing it. Yes, we are talking about the REST APIs. So what is REST APIs, and how are they used in creating Campaign objects is a question which has multiple aspects and areas. The HCL Campaign REST API to manipulate campaigns, offers, offer lists, attributes, and target cell objects.

What are REST APIs?

You are trying to search and book your flights on the internet, and in a few seconds, you have the results. That is the function an API performs, helping two systems talk to each other. REST is an approach that facilitates such communications by assisting in creating APIs keeping a specific set of rules in mind.

I work as a Unica Support Engineer and a Client Advocate, and I come across many different Unica use cases and questions. One thing I have observed is that while using REST API calls to create campaign objects, people struggle to do configurations required in the Platform. The challenges can vary, like using the sample JSON body, parameters needed to execute API calls, or updating the configuration values for any version of REST APIs. This article focuses and helps to understand and perform configurations in Platform. To execute REST API calls, we use the Postman tool as it’s been used by most of the users and our clients while working with REST API calls.

Configurations at Platform Side

1. Increase a token’s lifetime, which is used for authentication in API calls.

– Navigate to: Affinium|Manager|miscellaneous.

Increase Token Lifetime value as needed. It’s in seconds.

REST API in Campaign- Configuration at Platform

2. Change configurations for API authentication.

– Navigate to Affinium|suite|security|apiSecurity|manager|managerAuthentication

– Disable all properties.

– If you want to keep ‘require authentication for API access’ as true, it will validate the password for users used for API calls.

Assign some password for users from Settings >Users. If it’s disabled, you don’t need to pass any password.

REST API in Campaign- API Authentication

3. Navigate to Affinium|suite|security|apiSecurity|manager|Logout and change configuration value as below.

Campaign-REST API Change Configuration

4. Update configurations for Rest API Ver 1.0

Navigate to Affinium|suite|security|apiSecurity|campaign|Campaign REST API V2 Filter.

Update configuration values. Refer to the below screenshot.

Campaign REST API V2 Filter

– Restart the application server.

Postman tool to execute API calls.

Postman is a software development tool. It enables people to test calls to APIs. Postman users enter data. The data is sent to a special web server address. Typically, information is returned, which Postman presents to the user. Although you can use any tool. The main aim is to provide the necessary details while we are trying to make an API call. There are parameters like call types, request parameters (header, body), and the URL which are required for execution.

1. Execute POST API call to Platform to get token, which can be used in subsequence API calls for authentication.

Call: POST
URL : http://<HostName:Port>/unica/api/manager/authentication/login/
Headers :
M_user_name > user used for API calls for e.g. asm_admin
M_user_password > password set for user.

Campaign REST API- POST Call

Campaign REST API-Body

2. You can use this token ID for posting any API calls for Campaign rest APIs. List down offers- 

Call: GET
URL : http://<HostName:Port>/ Campaign/api/campaign/rest/v2/offers/search?search
Headers :
m_user_name  > asm_admin
m_tokenid         > <TokenID captured in platform post call>
api_auth_mode > manager

In the ‘search’ string, you can pass any string value to search specific offers.

Campaign REST API-Postman

Campaign REST API- Body

REST V2 example

List the particular offer details.

Call: GET
URL : http://<hostname:port>/Campaign/api/campaign/rest/v2/offers/29
Where 29 is offerID . Pass any offer ID for which you need to fetch the details.
Headers :
m_user_name > asm_admin
m_tokenid > <TokenID captured in platform post call>
api_auth_mode > manager

Campaign REST V2

Response :

Campaign REST V2-Response

How to create offers in Campaign?

Call: POST
URL : http://<HostName:Port>/Campaign/api/campaign/rest/v2/offers

  • Headers :
    m_user_name > asm_admin
    m_tokenid > <TokenID captured in platform post call>
    api_auth_mode > manager
    Content-Type > application/json
  • In query parameters, pass below values :
    securityPolicy: Policy name for e.g., ‘Global Policy.’
    folderid: folder ID under which we need to create offers for e.g., 4 [root folder for offers]
    templateName: campaign offerTemplate name from which offers to be created.
  • Body :
    Select the raw radio button and send JSON body.
    It will have the offer name and parameters. If not, parameters passed; it will create an offer with the default parameter value.

    [ {
    } ]

Create offers in campaign

How to create offers in campaign

Create offer with attributes

Create offer with attributes-V2

REST V1 Example

How to execute v1 rest APIs for campaign offer creation?

  • All configuration steps are the same as defined before.
  • Fetch platform tokenID with the same steps.
  • The only difference is with the data input type we need to pass in API calls.
    In v2, we observed we are passing input data as raw JSON.
    For v1, we need to pass all parameters as ‘x-www-form-urlencoded’.
    Call: POST
    URL : http://<HostName:Port>/Campaign/api/campaign/rest/v1/offers

Headers :

m_user_name > asm_admin
m_tokenid > <TokenID captured in platform post call>
api_auth_mode > manager

You don’t need to add content type, it will be automatically picked up with the input type we are going to select.

On-body section,the select radio button for ‘x-www-form-urlencoded’, pass the below values.

securityPolicy: Policy name for e.g. ‘Global Policy’
folderid: folder ID under which we need to create offers for e.g. 4 [root folder for offers]
templateName: campaign offerTemplate name from which offers to be created .
BulkOfferInfo : [{"offerName":"Offer API","attributes":[]}]

It will have the offer name and parameters. If not parameters passed, it would create an offer with the default parameter value. You can refer below the screenshot for request and response.

Create offer with attributes- REST V1

Create offer with attributes- V1

If we want to pass, offer parameters, update your request body by adding parameter values as needed :

{"offerName":"Offer Interact API_3",

Campaign REST API calls facilitate users to carry out operations like create+update+delete+List on campaign objects (offers, creating campaigns) without login into the Unica Application. To learn more about how REST API works with Campaign you can reach out to us.

Comment wrap
Further Reading
Marketing & Commerce | November 17, 2020
Unica Named a November 2020 Gartner Peer Insights Customers’ Choice for Multichannel Marketing Hub.
HCL Software is excited to announce that Unica, a leading enterprise marketing solution, has been recognized as a November 2020 Gartner Peer Insights Customers’ Choice for Multichannel Marketing Hub (MMH). Our team at Unica takes great pride in this distinction, as customer feedback continues to shape our products and services. In its announcement, Gartner explains, “The Gartner Peer Insights Customers’ Choice is a recognition of vendors in this market by verified end-user professionals, taking into account both the number of reviews and the overall user ratings.” To ensure fair evaluation, Gartner maintains rigorous criteria for recognizing vendors with a high customer satisfaction rate. Here are some excerpts from customers that contributed to the distinction: “A solid product with deep user community and good integrator expertise in region.”- Head Of Marketing Data & Analytics in the Finance Industry “HCL Unica is a great Campaign Management tool which generate good revenue for organisation.”- Senior Manager in the Services Industry "HCL Unica is a great ROI Marketing Automation tool.”- Associate Director in the Manufacturing Industry Read more reviews for Unica here. Everyone at Unica is deeply proud to be honored as a November 2020 Customers’ Choice for Multichannel Marketing Hub. To learn more about this distinction, or to read the reviews written about our products by the IT professionals who use them, please visit the Customers’ Choice announcement. To all of our customers who submitted reviews, thank you! These reviews mold our products and our customer journey, and we look forward to building on the experience that earned us this distinction! If you have a Unica story to share, we encourage you to join the Gartner Peer Insights crowd and weigh in. The GARTNER PEER INSIGHTS CUSTOMERS’ CHOICE badge is a trademark and service mark of Gartner, Inc., and/or its affiliates, and is used...
Marketing & Commerce | November 12, 2020
Manage TVC-Grid Validation in Unica Plan – A Systematic Way
Marketers are always looking for tools and processes to manage their marketing operations, streamline workflows, optimize the budget spend, resources, and manage other marketing assets. MRM is a single solution that can take care of all your needs, from strategic planning to executing a certain marketing activity and ensuring that consistency binds the team together. Unica Plan is the solution that Unica Suite offers to manage all your marketing needs and activities. HCL Unica Plan (Formerly known as Marketing Operations) supports the feature called Tabular View Control (TVC) Grid, where the marketer can choose and arrange the different attributes like Text, Numeric, Date, etc. which they want to use for tracking their business activities. Grids are mainly used for collecting data, in the user interface, it appears like a table or a list. You can enter data into the cells of the grid according to the selected attributes and their data type. Apart from this, the product supports the customization of grid attribute(s) with validation; for example, the attribute should start with a specific character/word OR attribute should not allow entering beyond a certain limit OR attribute should only allow data between a certain range, etc. “com.unicacorp.uap.grid.validation.plugin.GridValidatorPluginImpl” validator is delivered with HCL Unica Plan which can help you to define the validations on-grid attribute(s). This validation plug-in supports two types of rules. ROW: row-level rules are executed first. GRID: grid-level rules are executed after row-level rules. HCL Unica Plan ships with the following sample rules. BeginsWithRule DateCheckRule RangeCheckRule UniqueCheckRule This article will help you to understand the grid validation, data validation rules, and how to implement the ROW level validation using the "BeginsWithRule" rule with the Text Single Line Type attribute. Let’s follow the step by step approach to learning the validation. Create the new grid frame using the Form...
Marketing & Commerce | October 7, 2020
Unica Discover- Formulate Your Customer Experience Strategy
We’ve all experienced struggle in our day-to-day life as consumers. The struggle can be any number of things, such as adding something to your cart to find it out of stock or receiving product suggestions that have no relevance to you. As I write this, one of the UK’s largest retail bank’s online and mobile systems are unavailable, keeping me from viewing my account and making transfers – very frustrating for such a critical service.  All of these examples create friction in the user experience, reducing the perception of a brand and leading to sharing negative experiences with friends, family, or voicing it on social media. What is Customer Experience? Customer experience (CX) covers every aspect of a customer’s journey with your brand (first contact to becoming a happy and loyal customer.) It is a holistic perception a customer has for your brand or service irrespective of the engagement channel. It is what drives a customer to keep coming back to your product and ultimately become a brand advocate. Delivering a remarkable customer experience depends on how you, as a brand, interact at every touchpoint, like sending an email after a customer has made a purchase from your store or even the amount of customer rep's attention while solving a problem; everything matters. Why does Customer Experience Matter? With the rise of on-demand and quick delivery/shipping services, customers have come to expect and demand more. They want things faster, such as having items delivered within 24-48 hours. This raises customer expectations everywhere and ultimately increases the chances of frustration when it doesn’t happen. This is reflected in market research. 79% of digital experience professionals rate the customer experience they provide as very or extremely high priority. Great that these see the importance, but also leaving 21% who don’t! 90% of those...
a/icon/common/search Created with Sketch.