An Audience can be created in SAS Customer Intelligence 360 using the user interface or through the REST API endpoint. An Audience definition is the schema for your audience and can continually be used once it's created. In this post I'll use a REST API request to create an audience definition using the REST client Insomnia.
All REST API calls for Customer Intelligence 360 require authentication. So, the first step you'll need to take is to acquire a valid temporary token to authorize your requests. To do so, log into SAS Customer Intelligence 360 and navigate to API Credentials under General Settings. There, you'll create new API Credentials and generate a secret. Copy the secret generated and keep it in a safe location.
In Insomnia, create a new http request and select POST as the method. In the URL add the external gateway address external followed by /token.
In the body choose form URL Encoded. Here you'll add three rows (Figure 1).
Figure 1
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
Under Authorization, select Bearer and add a static JWT token. For more information on generating a static JWT please see the section titled Generate a Static JWT in the SAS Customer Intelligence 360 Admin Guide.
Click Send and copy the generated temporary token.
In Insomnia, create a new HTTP request and select POST for the HTTP method.
For the URL, enter the external gateway address. Then add the marketing audience (/marketingAudience) collection and the audiences endpoint.
Next, you'll need the json for creating an audience definition. I've found the easiest way to access this code is using the Audiences API documentation in support.sas.com and copying the sample json for creating an audience definition.
Back in Insomnia, in the body tab select json and paste the sample code. From here you can change the name of the definition, choose the identity type, and add the identity column name, and email column name. Below that, change the values so they match the columns in your data file (Figure 2).
Figure 2
For example, suppose the second column of my data file was for customer first names and the title of the column was first_name. The code would look something like this:
"columnNumber": 2,
"label": "first_name",
"dataType": "character",
"usedForTracking": "false"
Next, under Authorization, choose Bearer and paste the access token you created earlier.
Finally, submit the request. It should indicate a new definition has been created (Figure 3).
Figure 3
If you'd like, you may also go to Audience Definitions under General Settings in the UI to check as well. Your new definition should appear in that list.
Figure 4
If you’d like to learn more about creating an audience definition using the user interface, please see the course titled SAS 360 Audiences in the SAS Customer Intelligence 360 Learning Subscription. Or if you'd like to learn more about REST API's please see the course titled Managing Users, Settings, Content Delivery, and REST APIs in SAS Customer Intelligence 360 in the Customer Intelligence 360 learning subscription or the Customer Intelligence 360 Admin Guide.
Find more articles from SAS Global Enablement and Learning here.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.