Looked at the API
https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions/pull
more closely, and there are 2 hidden arguments. Would be nice if the explorer
did not hide them.
Works, once I provide the arguments:
Request
POST
https://pubsub.googleapis.com/v1/projects/mimic-integration-10-2019/subscriptions/telemetry:pull?key={YOUR_API_KEY}
{ "returnImmediately": true, "maxMessages": 10 }
Response
200 OK
{ "receivedMessages": [ { "ackId":
"WBFOBCEhPjA-RVNEUAYWLF1GSFE3GQhoUQ5PXiM_NSAoRRULUxNRXHUCRRBsVTN1B1ENGXN7NSY7UhsCBUcBdF9RGx9ZXH5KAFkEGHZ7ZXNiXBIACkNWVp_9-5a3oQ9vPGm409OgVFXLkN0hZhs9XBJLLD5-PTNFQV5AEkw2BkRJUytDCyo",
"message": {
"data": "eyJzbiI6IjIwOjE5OkFCOkY0OjI3OjFCIiwiZGF0YSI6eyJhY2MiOnsieCI6MjYsInkiOjMyLCJ6IjoxMDEyLCJ1bml0IjoibUcifSwiZ3lybyI6eyJ4IjoxMjIwLCJ5IjotNjgzNSwieiI6LTIzMTksInVuaXQiOiJtZGVnL3MifSwibWFnIjp7IngiOjQwLCJ5IjoxLCJ6IjotNCwidW5pdCI6InVUIn0sImxpZ2h0Ijp7InZhbHVlIjoxMzU1NywidW5pdCI6Im1MdXgifSwidGVtcCI6eyJ2YWx1ZSI6NTAwMDAsInVuaXQiOiJtQ2Vsc2l1cyJ9LCJwcmVzc3VyZSI6eyJ2YWx1ZSI6OTg4OTcsInVuaXQiOiJQYXNjYWwifSwiaHVtaWRpdHkiOnsidmFsdWUiOjM5LCJ1bml0IjoiJXJoIn19fQ==",
"attributes": {
"projectId": "mimic-integration-10-2019",
"deviceId": "mimic1",
"deviceNumId": "2683064391811245",
"deviceRegistryId": "mimic-registry",
"deviceRegistryLocation": "us-central1",
"subFolder": ""
},
"messageId": "789146468611865",
"publishTime": "2019-10-14T13:49:47.862Z" } } ] }