Categories API

You can use the categories API to retrieve, create, update, and filter category data in your Oracle Data Cloud taxonomy, which is a hierarchical tree structure that includes all your available categories. You can select categories from the taxonomy to build target audiences by grouping the categories into segments using OR logic and then include and exclude individual segments using AND or NAND logic.

Important: The Categories API deprecates the self-classification category and taxonomy APIs. If you are using these old APIs, you should migrate to this one to benefit from its additional parameters and features. These new features include the ability to create categories anywhere in your taxonomy, edit categories created by the Oracle Data Cloud Services Team, use new owner and public views to retrieve 1st and/or 3rd-party categories, and view the reach of your categories (by country and ID source).

Note: Users no longer create campaigns in the Oracle Data Cloud platform UI. The campaign workflow is now part of the audience workflow. The platform still uses campaigns to manage audience data delivery however. They are created automatically when a UI user delivers an audience. In the APIs, you create and use campaigns as before.

In this topic  

Explore the API

The embedded I/O doc below enables you to explore the API. The I/O  doc explains the parameters for each method and provides templates for your calls. You cannot make live API calls from the tool, however.

Open the link below in a new tab to see the I/O doc in a three-pane format.

categories15.docs.apiary.io/

For help with this API, contact My Oracle Support (MOS).

Service URI

The URI for the categories API is:

taxonomy.bluekai.com/taxonomy/categories

Schema

The URI for the categories API schema is:

taxonomy.bluekai.com/taxonomy/categories/category.schema

Read a category

To get information on a category, specify its ID as shown in the following GET call:

taxonomy.bluekai.com/taxonomy/categories/categoryID&bkuid=BKUID&bksig=BKSIG

For example, a GET call to /taxonomy/categories/288885 returns the following response:

{
  "id" : 288885,
  "name" : "Cat Owner",
  "parentCategory" : {
    "id" : 288884
  },
  "description" : "ACXM Interest, Pet Owner, Cat Owner",
  "partner" : {
    "id" : 303,
    "name" : "Acxiom Corporation"
  },
  "vertical" : {
    "id" : 23,
    "name" : "Branded Data - Acxiom"
  },
  "isPublicFlag" : true,
  "isForNavigationOnlyFlag" : false,
  "ownershipType" : "thirdParty",
  "isLeafFlag" : true,
  "pathFromRoot" : {
    "ids" : [ 344, 24148, 150555, 319645, 288849, 288884, 288885 ],
    "names" : [ "ROOT", "Branded Data", "Acxiom", "Basic Rate", "ACXM Interest", "Pet Owner", "Cat Owner" ]
  },
  "status" : "active",
  "links" : [ ]
}

Response properties

Property Type Description
buyerPrice integer The price set by the category provider for the current buyer. This property overrides the value of universalPrice. Value of -1 indicates that a buyer-specific price has not been set for the category.
categoryPrice integer The actual category price for the buyer. Its value is typically the same as the universalPrice value unless overridden by a buyer-specific rate card.
description string A description of the category that includes its path of parent nodes
id integer The unique ID assigned to the category
isForNavigationOnlyFlag boolean If true, this category will be a parent node used for navigation and cannot be added to an audience. The default value is false.
isLeafFlag boolean (Read only) If true, indicates that this category is a leaf node (the last node in the taxonomy path) in the current request's view.
isPublicFlag boolean (Read only) If true, the category is public. The default value is false.
links array A list of links to additional metadata (if applicable)
name string (Required) The name of the category node
ownershipType string (Read only) Indicates the type of data ownership, which can be one of the following:
  • firstParty: Categories in your private first-party taxonomy
  • secondParty: Private categories that another DMP partner has shared with you
  • thirdParty: Categories available to all DMP partners
parentCategory object (Required) An object that includes the unique ID and name assigned to the category's parent node
partner object (Required) An object describing the owner of a category, including their partner ID and name
pathFromRoot object An object with an array of IDs in the full path from root to the category
status string

Indicates the status of the category, which can be one of the following:

  • active: The category is active.
  • deleted: The category was removed.
  • draft: Oracle internal use only
universalPrice integer The default category price set for all buyers unless overridden by a buyer-specific rate card
vertical object The top-level category of this category

List categories

You can combine various query parameters to request a filtered set of categories.

List all the categories that you own

To view all the categories that you own, specify the required view and partner.id parameters as shown in the following GET call:

taxonomy.bluekai.com/taxonomy/categories?view=OWNER&partner.id=partnerID&bkuid=BKUID&bksig=BKSIG

Sample list response:

List the public categories

To view all the public (third-party) categories, specify view=PUBLIC and your partner ID as shown in the following GET call:

taxonomy.bluekai.com/taxonomy/categories?view=PUBLIC&partner.id=partnerID&bkuid=BKUID&bksig=BKSIG

Note: It can take a while to get a response because this call includes so many categories.

Sample list response:

List the buyer view of categories

To view all the public (third-party) categories plus the first- and second-party categories in your private (managed) and self-classification trees, specify view=BUYER and your partner ID as shown in the following GET call:

taxonomy.bluekai.com/taxonomy/categories?view=BUYER&partner.id=partnerID&bkuid=BKUID&bksig=BKSIG

Note: It can take a while to get a response because this call includes so many categories.

Sample list response:

List example for categories without reach

The following list call requests all categories to a depth of four levels (numOfLevels=4) from the root category (parentCategory.id=344). By default, the response does not include reach statistics for each category.

https://taxonomy.bluekai.com/taxonomy/categories?parentCategory.id=344&numOfLevels=4&partner.id=partnerID&view=BUYER&bkuid=BKUID&bksig=BKSIG

Sample list response without reach statistics:

List example for categories with reach

The following list call requests all categories to a depth of four levels and it includes reach statistics for each category because it specifies showReach=true.

https://taxonomy.bluekai.com/taxonomy/categories?parentCategory.id=344&numOfLevels=4&partner.id=partnerID&showReach=true&view=BUYER&bkuid=BKUID&bksig=BKSIG

The response includes a stats object for each category that specifies "reach" : integer.

Important: If you set showReach to true, the response time may increase significantly depending on the number of categories being returned and the specified options.

Sample list response with reach statistics:

Export categories

To export categories, filter your GET request with the desired query parameters as shown in the following example:

/taxonomy/categories/export?view=BUYER&partner.id=2208&showReach=true&parentCategory.id=17&parentCategory.id=3&numOfLevels=1

Sample response:

17      Autos   ROOT>In-Market>Autos    3       252351600
3       In-Market       ROOT>In-Market  344     1016820000

Note: Export does not support the addStats parameter.

Create a category

To create a category, include your partner ID and a request body in the following POST call:

/taxonomy/categories?partner.id={yourPartnerId}

Sample request body specifying required fields:

Bulk create

To create multiple categories, include your partner ID and a request body in the following POST call:

/taxonomy/categories?partner.id={yourPartnerId}

Sample request body specifying multiple categories:

Bulk import (via file upload)

To create and edit multiple categories at the same time by uploading a TSV or TXT file:

  1. In the query string of your call to the Categories API,append import to the path.

    serviceUrl = 'https://taxonomy.bluekai.com/taxonomy/categories/import?partner.id={yourPartnerId}'

  2. In the headers field, set the Content-Type to multipart/form-data .

    headers = {"Content-Type": "multipart/form-data; "Accept": "application/json","User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:22.0) Gecko/20100101 Firefox/22.0"}

  3. Include a parameter that is set to the name of the .tsv or .txt file to be imported.
  4. Verify that the import file has the following columns:
    FieldData typeRequired?Description
    Idstringrequired (for editing catgories)The unique ID assigned to the category. This column is required for editing categories via bulk import because bulk import identifies categories based on the unique category IDs..
    NamestringoptionalA unique, concise name for the category. The category will be listed by this name in your taxonomy. The name may be a maximum of 255 characters. You only need to provide a name if you arechanging the name of a category.
    Pathstringrequired (for adding catgories)The full taxonomy path of the category. This column is required for adding categories via bulk importbecause it determines where they are added in your taxonomy.
    ParentCategoryintoptional (required for moving categories)The unique ID assigned to the category directly above the selected category in your taxonomy. This column is required for moving categories via bulk import.
    DescriptionstringoptionalA verbose summary of the type of users included in with this category. The description may be a maximum of 255 characters.
    StatusenumoptionalSelect whether the category is to be placed in the Active or Draft state. The default value of this setting is based on the parent category. Changing the status of parent category also updates the status of all the child categories underneath it. If a parent node is in the Draft state, you cannot make any of its child nodes Active.
    • Active. The category is published to your taxonomy. This means that it is visible in the Audience Builder and Taxonomy Viewer, may be added to audiences, and may be shared with other clients.
    • Draft. The category is only visible in the Taxonomy Manager. It cannot be used in the Audience Builder or Taxonomy Viewer, and it cannot be shared.
    NavigationOnlybooleanoptionalLimits the functionality of this category to a parent node that cannot store user profile data, accumulate inventory, or be added to audiences. A navigation node essentially functions as a folder for one or more child categories.The default value is false.
    ExcludeFromAnalyticsbooleanoptionalExcludes the category from audience analytics reports. The default value is false.
    MutuallyExclusiveChildrenbooleanoptionalMakes the child categories under this category mutually exclusive (only the most recently tagged child category is in the user's profile). You may only create a flat list of mutually exclusive child categories. Mutually exclusive categories may not have any child categories below them---unless you mark the mutually exclusive categories as navigation-only nodes

Bulk import demo

The samplebulk_categories_import.py Python code demonstrates how to do a bulk category import using the Categories API. To run this script, you must have the following:

You can use PIP (a Python Package Installation tool) to help install the requests library. To download and install PIP, install the requests library, and then delete the PIP installation file, enter the following commands in your console:

curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py
sudo pip install requests
rm get-pip.py

To run this script, you need to create a TSV file named category_import.tsv (download template) that contains the categories you want to edit or create, and provide the following parameters:

  • url: The URL of the Oracle Data Cloud platform's production environment (services.bluekai.com)
  • verbosity: Enter a series of four verbose options for printing information.
  • partnerid: The partner ID associated with the seat for which you are uploading categories.
  • bkuid: Your web service user key
  • bksecretkey: Your web service private key

The following example demonstrates the required syntax for calling this script:

bulk_categories_import.py --url https://services.bluekai.com -v -v -v -v --partnerid Partner ID--bkuid WebServiceUserKey --bksecretkey WebServicePrivateKey

Update a category

To update a category in your private taxonomy, include a request body with a PUT call that includes your partner ID and the category ID.

Sample PUT request:

/taxonomy/categories/{categoryId?partner.id={yourPartnerId}

Sample request body specifying category values:

Bulk update

To update multiple categories in your private taxonomy, specify them in the request body with your PUT call:

Sample bulk PUT request:

/taxonomy/categories?partner.id={yourPartnerId}

Sample request body specifying updates to multiple categories:

Query parameters

The categories API supports following query parameters:

Parameter Type Description
addStats boolean If set to true, returns the stats object, which includes various statistics for the specified category, such as reach. The default value is false.
Example: &addStats=true
NoteExport does not support this parameter.
countryCode string The two-letter code for the country by which to limit the statistics for the category. Defaults to US unless you specify other values.For more details, see countries API.
Example: &showReach=true&countryCode=GB
deviceType string (Deprecated) Specify either desktop or mobile to query statistics by device type.
Example: &addStats=true&deviceType=mobile
expand boolean If set to true, more details are returned. This parameter is only used for exporting a TSV file. The default value is false.
Example: &expand=true
idTypes integer

Filter by the ID source, which can be one of the following standard types:

  • 1: Oracle Data Cloud 3rd Party Desktop Cookie ID

  • 2: Oracle Data Cloud Mobile Statistical ID

  • 3: Oracle Data Cloud Mobile Cookie ID

  • 6: Google Advertising ID (AdID)

  • 9: Apple IDFA

Example: &showReach=true&idTypes=9
numOfLevels integer Limit the category tree search by levels
parentCategory.id integer Specify the ID of the parent category.
The default value is 344, which is the ROOT category.Example: &parentCategory.id=17
partner.id integer (Required) The unique ID of the partner
This parameter can be used with other parameters, such as view.
Example: &partner.id=1234
q string

Filter the returned categories according to their id or name properties. Operators: use eq (equals) with the id and co (contains a string enclosed in double quotes) with the name. Depending on the context from where you issue the query that contains the filter expression, you may need to use percent encoding. For example, if you execute a query as a cURL command, then the filter expression must replace white spaces with %20 and double-quotes around strings with %22.

Example: https://taxonomy.bluekai.com/taxonomy/categories?view=BUYER&partner.id=2680&q=name%20co%20%22Cloud%22

recency integer Specify the maximum number of days since a user was last tagged with a category attribute for the category (the default is 90 days). This number is used to calculate reach.
Example: addStats=true&recency=2
showPriceAt date A date in ISO 8601 date and time format (yyyy-MM-dd'T'HH:mm:ssZ) to determine what the price was on that date. For example: showPriceAt=2017-06-18T17:46:32-05:00
showReach boolean If set to true, include the inventory figures for the specified categories.
If you set showReach to true, the response time may increase significantly depending on the number of categories being returned and the specified options.
view string (Required) Filter's the response based on the following values:
  • BUYER: Returns all first- and second-party categories in your taxonomy and third-party categories in the Oracle Data Marketplace. See a sample response.
  • OWNER: Returns all first-party categories in the owner's taxonomy. See a sample response
  • PUBLIC: Returns all third-party categories in the Oracle Data Marketplace. See a sample response
You must include your partner.id with the view parameter.

Example: taxonomy.bluekai.com/taxonomy/categories?view=OWNER&partner.id=1234

FAQs

Related API calls

Here are the API calls you will typically make after you use the categories API:

Post-categories API Use case
Audiences API Use categories to create the audience you want to target, model, optimize, or analyze.
Campaigns API Create instructions for delivering your audience to a partner.
Segment reach API Get the reach (estimated number of unique users) for the individual categories and segments in your audience.
Taxonomy partner permissions API Share or withhold access to your first-party categories.

Learn more

Rules API

Managing your taxonomy

Percent-encoding