I’m trying to connect with Vertex AI from my Bubble app. I followed the regular documentation provided by Google and generated the necessities (gcloud auth access-token, and other parameters) required by the given cURL API:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/publishers/google/models/MODEL_ID:streamGenerateContent"```
I followed the perfect JSON schema as well to call the API using the Bubble API Connector.
{
“contents”: [
{
“role”: “user”,
“parts”: { “text”: “Hello!” }
},
],
}```
But when I call the API it shows this error (see image):
Note that the gcloud auth token expires very often; mostly after an hour, which should also cause an error. I tried multiple times within the time range and got the same error and showed the above error mentioning “reason”: “ACCESS_TOKEN_TYPE_UNSUPPORTED”.
How do I solve this ? Any suggestions would help.
PS: I don’t code