-
Notifications
You must be signed in to change notification settings - Fork 0
Google Pubsub
Prayag edited this page Mar 29, 2023
·
4 revisions
https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/publish
PROJECT=my-project
TOPIC=my-topic
ACCESS_TOKEN=<token printed received from oauth2>
curl -H 'content-type: application/json' -H "Authorization: Bearer $ACCESS_TOKEN" -X POST --data $'{ "messages": [{"data": "abcd"}]}' https://pubsub.googleapis.com/v1/projects/$PROJECT/topics/$TOPIC:publish
{
"messageIds": [
"7327041210749056"
]
}
curl -H 'content-type: application/json' -H "Authorization: Bearer $ACCESS_TOKEN" https://pubsub.googleapis.com/v1/projects/$PROJECT/topics/$TOPIC/subscriptions