Mysterious URL parameter in some v1alpha API endpoints path

Hello guys,

I noticed that for some API endpoints, the URL path is : https://chronicle.googleapis.com/v1alpha/{api_version}/projects/{project_id}/locations/{region}/instances/{instance} (instances.get), but I could not figure out what the api_version parameter is supposed to be. I tried to simply ignore it but the URL is then invalid (HTTP 404).

For reference, the vast majority of the API endpoints I used yet have a path like so : https://chronicle.googleapis.com/v1alpha/projects/{project}/locations/{location}/instances/{instance}/ruleExecutionErrors  (ruleExecutionErrors.list). The api_version parameter is not present in those.

What should I put for api_version in the URL path ? If this variable can change through time, how can I get the correct/current value for it ?

Regards

Solved Solved
1 4 323
1 ACCEPTED SOLUTION

The doc here is basically listing api_version twice. The current API version is "v1alpha", and this will hopefully soon be released as just "v1", though the v1alpha route will still work. 

Sharing some auth info, since that can be unclear as well:

Here is an example auth flow for an API with a JSON Key: https://gist.github.com/emeryray2002/428d9f07e66be2cc817b73e26e78442b

Here is an example auth flow with the GCP Application Default Credential (service account/user identity via gcloud cli): https://gist.github.com/emeryray2002/9794164d69d7df83a75b4e63dfa13aab

 

 

View solution in original post

4 REPLIES 4

The doc here is basically listing api_version twice. The current API version is "v1alpha", and this will hopefully soon be released as just "v1", though the v1alpha route will still work. 

Sharing some auth info, since that can be unclear as well:

Here is an example auth flow for an API with a JSON Key: https://gist.github.com/emeryray2002/428d9f07e66be2cc817b73e26e78442b

Here is an example auth flow with the GCP Application Default Credential (service account/user identity via gcloud cli): https://gist.github.com/emeryray2002/9794164d69d7df83a75b4e63dfa13aab

 

 

Hello,
Thanks for your answer.
I still cannot perform the request, I tried the following but none seem to work (still getting 404 errors) :
GET https://chronicle.googleapis.com/v1alpha/projects/{project_id}/locations/{region}/instances/{instance} 
GET https://chronicle.googleapis.com/v1alpha/v1alpha/projects/{project_id}/locations/{region}/instances/{instance}
GET https://chronicle.googleapis.com/v1alpha/v1/projects/{project_id}/locations/{region}/instances/{instance}

😞

 

A few things to check would be that the service account credential you are using has the correct permissions for the Chronicle API in that project. The project number and customer ID number also need to be correct. Your first example is correct, but it's missing the actual endpoint. Send me a DM if you want specific help on what you're trying. You can also use Dev Tools in your browser to see how the front end is calling those APIs, which can be helpful. 

Hello, the issue was between the keyboard and the chair. An unfortunate copy-paste led me to send POST requests instead of GET 8). Sorry to have bothered you and again, thanks for your help.

Troubleshooting steps :
- Use of the Google Colab Notebook to verify that my credentials were OK -> I got a succesful response for instances.get + I could see the URL path used in it
- Check my instances.get python interface implementation in details

So, regarding the original question, we can (as of today) ignore the {api_version} parameter in the URL paths of the API endpoints since its a duplicate of the "v1alpha" already present in the base URL.