Get started with the CSS API

Here's how to use the CSS API:

Permissions

To work with the CSS API, you need to configure permissions in two places: Google Cloud and CSS Center.

  1. Google Cloud IAM:

    • Create a service account in the Google Cloud Console. Follow similar instructions as for the Content API to create and download the JSON credentials file. This step authenticates your service account as a valid Google Cloud entity.
    • If you're using direct REST access or the Google API Client libraries, you also need an API Key generated from the Google Cloud Console.
  2. CSS Center:

    • The service account email address (e.g., your-service-account-name@your-project-id.iam.gserviceaccount.com) must be added as a user with Admin access to your CSS Center account. This step authorizes the service account to access and manage your CSS Center data.
    • You can grant access at the CSS Group level (for access to all domains) or to specific CSS Domain accounts. For API access, granting access at the CSS Group level is common.
    • To add the service account:
      • Sign in to CSS Center with an administrator user.
      • Navigate to Account access (under the gear icon ⚙️).
      • Click + Add user and enter the service account email.
      • Set the access level to Admin.
    • Permissions may take up to 30 minutes to propagate. If you encounter permission errors, try again later.

Authentication Scope:

The required OAuth 2.0 scope for the CSS API is:

  • https://www.googleapis.com/auth/content

Verify that your application requests this scope when authenticating.

Enable the CSS API

In order to use the CSS API, you need to enable it in your Google Cloud project. You can find the library at https://console.cloud.google.com/apis/library/css.googleapis.com.

Start programming

The CSS API has code samples, and client libraries to help you get started. We also have a best practices page.

Send requests

Send requests to URLs in the following format:

https://css.googleapis.com/{version}/{resource name}:{method}

Where {resource name} is the name of the resource your call impacts.

For example, here's how to delete a resource with gRPC:

https://css.googleapis.com/v1/{resource name}:delete

Here's how to delete a resource with REST:

DELETE https://css.googleapis.com/v1/{resource name}

See the CSS API reference documentation for more details on specific services.

Use gRPC or REST

The CSS API supports gRPC and REST. Here are the two ways to make CSS API calls:

gRPC (recommended) REST
  1. Create the body of the request as a protocol buffer.
  2. Send the request body to the server with HTTP/2.
  3. Deserialize the response to a protocol buffer.
  4. Interpret the results.
  1. Create the body of request as a JSON object.
  2. Send it to the server using HTTP 1.1.
  3. Deserialize the response as a JSON object.
  4. Interpret the results.

Get help

Contact your Google representative for support, or use the feedback form to report any issues.

Here's how you can provide more feedback if you experience issues:

Give feedback

To provide feedback, submit one of the following:

  • API features: Submit the feedback form
  • Documentation: Use the in-page thumb ratings and Send feedback button.
  • Samples and libraries: Use the New issue button on GitHub.

To provide general feedback after implementing each task, use the feedback form.