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:
- Download the sample Python code.
- Enter your API keys in its
bkuid
andbksecretkey
fields. - Enter the service URI.
- If you are sending a POST or PUT request, enter the JSON body to be included in the call.
- Specify the API request method. To do this, uncomment the
newUrl
reference variable anddoRequest()
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) |