Settings API

This is a premium plugin feature. If you do not have the premium plugin, yet you can get it here: cookie banner homepage. You need at least version 2.5.0 of the premium plugin and at least version 2.14.1 of the main plugin.

Download a postman collection for a quick start and more details: Postman collection

The API has two requests:

  1. GET Settings
  2. POST Settings

You have to make authenticated requests. To authenticate a request you need WordPress application credentials, see: how to get application credentials

User must have “manage_options” capabilities.

GET Settings

GET /wp-json/beautiful-and-responsive-cookie-consent/v1/settings

Retrieve all the cookie banner settings. You can use the response of the request for the POST Settings request.

Response

Example Response Body

[
    {
        "option_name": "nsc_bar_activate_banner",
        "option_value": "1"
    },
    {
    .......
]

POST Settings

POST /wp-json/beautiful-and-responsive-cookie-consent/v1/settings

Update settings of cookie banner.

Body
[
    {
        "option_name": "nsc_bar_ask_until_acceptance",
        "option_value": "1"
    }
]

Submit all values you want to update.

Response

Example Response Body

[
    {
        "option_name": "nsc_bar_ask_until_acceptance",
        "update_success": true
    }
]

Returns an array of all submitted options with indicator if they are successfully updated.