Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP POST between Postman and EventHub

Can someone help me. I want to send data from Postman (Chrome APP) to my EventHub via HTTP POST. I was successful a while ago but have lost the documentation.

I have the following credentials: EventHub URL in the form https://NAMESPACE.servicebus.windows.net/EVENTHUBNAME/messages

DataSend name

DataSend key

Thanks

like image 957
Joe Avatar asked Aug 31 '25 17:08

Joe


1 Answers

We recently updated our REST documentation - guess SEO is taking its sweet time.

Here's the documentataion.

Most crucial among all is to generate the `SharedAccessSignature` token. Use: `SharedAccessSignatureTokenProvider.GetSharedAccessSignature()` or `SharedAccessSignatureTokenProvider.GetPublisherSharedAccessSignature()` from ServiceBus SDK to generate it, based on your scenario. Here's the sample Rest request:

POST https://SBNAMESPACE.servicebus.windows.net/EVENTHUBNAME/messages

HEADERS:
Authorization: SharedAccessSignature sr=sb%3a%2f%2fSBNAMESPACE.servicebus.windows.net%2fEVENTHUBNAME%2fPublishers%PUBLISHER_NAME&sig=%<dymmyguid>&se=1473789915&skn=RootManageSharedAccessKey
Content-Type: application/atom+xml;type=entry;charset=utf-8
x-ms-retrypolicy: NoRetry

BODY:
{ "DeviceId":"dev-01", "Temperature":"37.0" }

Here's a code Example to create the `SharedAccessSignature` & avoid calling SERVICEBUS SDK.

like image 172
Sreeram Garlapati Avatar answered Sep 02 '25 10:09

Sreeram Garlapati