Using the REST API

The Hangouts Chat REST API provides a way
for bots to establish context for their operation. You can use the API to
perform the following operations:

List the spaces that the bot has been added to

List the members that belong to a space

Create, delete, and modify messages

To use this API, you must
create a service account
and use the service account to invoke the API. The service account must be
authenticated before you can do this, because there is no interactive auth flow
for service accounts.

Authentication using a service account is a prerequisite
for using the Hangouts Chat REST API.

Authorizing the service account

Before making any calls to the API, your code needs to authenticate using OAuth
2.0, with credentials for the service account associated with your bot. The
authorization call will resemble this one from the async HTTP bot sample: