oauth2 playground – Google Cloud Search third-party support initialization does not complete

I am setting up a Google Cloud Search project. I’ve gotten as far as step 5.3 in the guidance at developers.google.com/cloud-search/docs/guides/project-setup for “Configure access to the Google Cloud Search REST API”. I’m using the OAuth 2.0 Playground at developers.google.com/oauthplayground to do this setup.

The OAuth 2.0 Playground appears to handle the construction of the POST request needed in step 5.3, but I haven’t been able to get the request to be successful. My request looks like

POST /v1:initializeCustomer HTTP/1.1
Host: cloudsearch.googleapis.com
Content-length: 26
Content-type: application/json
Authorization: Bearer (access token redacted)
Accept: application/json

--data '{}'
--compressed

(the gap between the Accept: header line and the body (starting with –data) is intentional – it’s displaying that way in OAuth Playground)

and produces

HTTP/1.1 400 Bad Request
Content-length: 171
X-xss-protection: 0
X-content-type-options: nosniff
Transfer-encoding: chunked
Vary: Origin, X-Origin, Referer
Server: ESF
-content-encoding: gzip
Cache-control: private
Date: Fri, 07 Feb 2025 13:03:56 GMT
X-frame-options: SAMEORIGIN
Alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Content-type: application/json; charset=UTF-8

{
  "error": {
    "status": "INVALID_ARGUMENT",
    "message": "Invalid JSON payload received. Unable to parse number.\n--data '{}' \\n--comp\n^",
    "code": 400
  }
}

instead of the expected instance of operation shown in the guidance. I’ve tried variations on the request body, such as

--data '{}' --compressed
with similar results. I’ve left the body empty, and received a 500 error. I’ve done some web searching for a solution, but the results have been geared toward PHP or application code vs. making a POST request via the OAuth Playground web interface.

Read more here: Source link