4

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

Joe
  • 123
  • 2
  • 3
  • 10

1 Answers1

8

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=%2bbkNx23XC%2bWiFjD7%2bZi8qcDULdcnOEdLuef4dgEulx8%3d&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.

Sreeram Garlapati
  • 4,877
  • 17
  • 33
  • Can you create the SharedAccessSignature without the ServiceBus SDK? – DauleDK Feb 06 '17 at 15:37
  • 2
    @DauleDK They added [code examples](https://learn.microsoft.com/en-us/rest/api/eventhub/generate-sas-token) for that in the meantime. – mweber Aug 24 '17 at 14:52