Programming example

You can use the Python code below to call any of the Oracle Data Cloud APIs. This code takes your Oracle Data Cloud API keys, the service URI, and the method request to generate an authentication signature, construct the URL path, make the call, and display the response.

To use this programming example:

  1. Download the sample Python code.
  2. Enter your API keys in its bkuid and bksecretkey fields.
  3. Enter the service URI.
  4. If you are sending a POST or PUT request, enter the JSON body to be included in the call.
  5. Specify the API request method. To do this, uncomment the newUrl reference variable and doRequest() method for the method you want to call. Make sure you comment out all other methods.

You can use the following examples to configure the sample Python code. The examples demonstrate how to pass sort and filter parameters in the query string for GET (list) requests, pass the item ID in the URL for GET (read) and PUT requests, and pass the JSON body for POST and PUT requests.

API URI JSON body data API request method
Campaign services.bluekai.com/Services/WS/Campaign?campaignId=campaign_id {"name": "Renamed Example Campaign"} PUT
Containers services.bluekai.com/Services/WS/sites/site_id GET (Read)
Segment reach services.bluekai.com/Services/WS/SegmentInventory {"AND":[{"AND":[{"OR":[{"cat":17}]}]}]} POST
Taxonomy services.bluekai.com/Services/WS/Taxonomy?fullpath=1&bkSize=1 GET (List)