ericferon / glpi-webhook

GNU General Public License v2.0
20 stars 5 forks source link

Error with Google Spaces #30

Closed rafael-menezes-truechange closed 1 year ago

rafael-menezes-truechange commented 1 year ago

Greetings,

While trying to create a link to a Google Spaces chat, I've received an error caused by the Webhook system not correctly parsing the token to the system. The error goes as follows:

Error: call to URL https://chat.googleapis.com/v1/spaces/REDACTED/messages?key=REDACTED&token=REDACTED failed with status 403, response { "error": { "code": 403, "message": "The API is called without a valid token. Instructions on how to use incoming webhooks can be found at https://developers.google.com/chat/how-tos/webhooks", "status": "PERMISSION_DENIED" } } , curl_error , curl_errno 0

Checking in the internet, someone mentioned that the "&" character may have to be commented with an "^", and when I tried that, the error got different as well.

Error: call to URL https://chat.googleapis.com/v1/spaces/REDACTED/messages?key=REDACTED^&token=REDACTED failed with status 400, response { "error": { "code": 400, "message": "API key not valid. Please pass a valid API key.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "API_KEY_INVALID", "domain": "googleapis.com", "metadata": { "service": "chat.googleapis.com" } } ] } } , curl_error , curl_errno 0

Can you provide some support at this issue?

ericferon commented 1 year ago

Hi, Unfortunately, I cannot help you : the HTTP request coming into Google Spaces seems erroneous and I don't know their API, nor your security token. You should test it with Postman or curl, to see how to make it working. K.r,