Ich versuche, Direct Batch send API zu implementieren, um Benachrichtigungen zu senden. Verwenden von Postman zum Simulieren der Anfrage. Und es gibt den ungültigen Autorisierungs-Token-Fehler zurück.So implementieren Sie Direct Batch Senden von Microsoft Azure API
Beitrag Gesuch:
https://mynamespace.servicebus.windows.net/myHub/messages/ $ batch direkte & api-version = 2015-08
Mit unterhalb Headers:
Content-Type: application/json Berechtigung: SharedAccessSignature sr = https://mynamespace.servicebus.windows.net/myHub/messages/ $ batch? direct% 3fapi-version% 3d2015-01 & sig = xxxx & se = xxxx & skn = StandardFullSharedAccessSignature
So, wie dieser Fehler behoben?
Auch gibt es ein APNS Beispiel:
POST https://{Namespace}.servicebus.windows.net/{Notification Hub}/messages/$batch?direct&api-version=2015-08 HTTP/1.1
Content-Type: multipart/mixed; boundary="simple-boundary"
Authorization: SharedAccessSignature sr=https%3a%2f%2f{Namespace}.servicebus.windows.net%2f{Notification Hub}%2fmessages%2f%24batch%3fdirect%26api-version%3d2015-08&sig={Signature}&skn=DefaultFullSharedAccessSignature
ServiceBusNotification-Format: apple
Host: {Namespace}.servicebus.windows.net
Content-Length: 511
Expect: 100-continue
Connection: Keep-Alive
--simple-boundary
Content-Type: application/json
Content-Disposition: inline; name=notification
{"aps":{"alert":"Hello using APNS via Direct Batch Send!!!"}}
--simple-boundary
Content-Type: application/json
Content-Disposition: inline; name=devices
['Device Token1','Device Token2','Device Token3']
--simple-boundary--
--simple-boundary
Content-Type: application/json
Content-Disposition: inline; name=notification
{"aps":{"alert":"Hello using APNS via Direct Batch Send!!!"}}
--simple-boundary
Content-Type: application/json
Content-Disposition: inline; name=devices
['Device Token1','Device Token2','Device Token3']
--simple-boundary--
Wie es mit Postman testen?