Consent Manager API - Modify Configurations

This API allows you to modify consent configurations that exist within your Osano Admin Application.

Using the API

In the Osano Web Applicaiton (my.osano.com):

- Log in as an Administrator. 

- Click on "Settings" (gear icon on the top-right of the screen).

- Choose API Keys.

- Click the green "+" to add a new key.

- When prompted, click "confirm" to generate a new API Key.

- Copy this key for safekeeping. (Once it disappears, you will not be able to access it again.) The API key will last for 5 years before it expires and is no longer valid. 

 

In your preferred API Client (ex. Postman or similar tools): 

In your API request:
  • Method: POST
  • Endpoint: https://customer.api.osano.com/graphql
  • Provide the token garnered above as a Bearer type in the Authorization settings.
This endpoint currently has two supported operations. 
    • (1) Updating Styling
    • (2) Updating "Settings" or additional properties
 

In order to update a configuration, you must provide the configuration ID. To get this value, use the "Get Code" button to obtain your Osano.js. Your osano.js will contain your Customer ID and your Configuration ID

https://cmp.osano.com/CustomerID/ConfigruationID/osano.js

 

Updating Styling

Possible Palette Properties

"palette":{
  "type":"object",
  "properties":{
      "dialogType":{
          "type":"string",
          "enum":[
              "bar",
              "box"
          ]
      },
      "infoDialogPosition":{
          "type":"string",
          "enum":[
              "right",
              "left"
          ]
      },
      "widgetPosition":{
          "type":"string",
          "enum":[
              "right",
              "left"
          ]
      },
      "buttonBackgroundColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "buttonForegroundColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "buttonDenyBackgroundColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "buttonDenyForegroundColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "dialogBackgroundColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "dialogForegroundColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "infoDialogOverlayColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "infoDialogBackgroundColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "infoDialogForegroundColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "linkColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "toggleOffBackgroundColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "toggleButtonOffColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "toggleOnBackgroundColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "toggleButtonOnColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "widgetColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "widgetOutlineColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      },
      "widgetFillColor":{
          "type":"string",
          "pattern":"^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((=
-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))$"
      }
  },
  "additionalProperties":false
}

The GraphQL query bodies: 

  • Update Styling via the API:
    mutation {
    updateStyling(
      input: {
        configName: "testing"
        configId: "53431cd9-5823-41ac-8b47-3dadffb99ce0"
        newStyling: { theme: "theme12", palette: { linkColor: "#000" } }
      }
    ) {
      ... on Config {
        configId
      }
    }
    }

Updating "Settings" or additional properties and sub-properties

Possible properties and sub-properties

- name
- domains
- configuration
- ccpaRelaxed
- crossDomain
- theme
- timeoutSeconds
- rootPath
- storagePolicyHref
- mode
- orgs (via name)

The GraphQL query bodies: 

  • Update properties via the API (example request):
mutation {
updateProperties(
  input: {
    configName: "espresso"
    configId: "f651a88d-261e-456e-b620-d7ea5d38d299"
    newProperties: {
      name: "new_espresso"
      domains: ["espresso.com", "latte.com"]
      configuration: {
        ccpaRelaxed: false
        crossDomain: true
        theme: theme5
        timeoutSeconds: 9
        rootPath: ""
        storagePolicyHref: "/coffee.html"
      }
      mode: debug
      orgNames: ["USA", "LATM"]
    }
  }
  webhookURL: (optional: ex. https://mydomain.com/mydata)
) {
  ... on Config {
    configId
  }
}
}
  • Update properties via the API (example response):
    {
      "data": {
          "updateProperties": {
              "configId": "f651a88d-261e-456e-b620-d7ea5d38d299"
          }
      }
    }