0

I'm building a chat bot using Hangouts API and some of the API methods are not working, I receive the response:

 {
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "status": "INVALID_ARGUMENT"
  }
}

For example, when I get the spaces my bot is a member, it returns all spaces just fine. Then I try to use some of these spaces id to get the member list, and it returns that the request contains an invalid argument. I can't see what I'm doing wrong...

The token can't be the issue because it works fine to get the spaces.

enter image description here

EDIT: The create message method returns a different error: enter image description here

sirmd
  • 41
  • 5

1 Answers1

0

I figured it out... My company have a lib to generate a token for google's apis and the email that was used in the request was the current user email, but, for the bot it must be used the email associated with the service account, I switched that and it started working. I think it shouldn't generate a token case the credentials are not valid because I couldn't figure out what was wrong.

Source where I found this: https://developers.google.com/hangouts/chat/how-tos/rest-api#authorizing_the_service_account

sirmd
  • 41
  • 5