'How To Get Google Event Messages From Pub/Sub service in terminal?

Is there a command to get the Message body as shown in the Google Cloud Platform Console Subscriptions (relating to event triggers from Nest Doorbell Device) in the terminal?

If not, how can I make an API request to the Pub/Sub service and receive the same JSON Payload shown in the GCP Console?

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source