Azure event hub send message with bearer token - azure-eventhub

Hi I have obtained a bearer token to send message to event hub after registering an application in azure active directory. I attempted to send a message using event hub message endpoint but constantly getting 500 error. Is there any place where I can see the detailed error or is this style of using bearer token to send message is supported at all?

Related

Facebook messenger webhook did not receive any messages

I am a beginner to use Facebook Graph API. I'm trying to set up a webhook to receive and send messages (or just only send messages). I have already verified it and succeeded. Then my webhook's also received messages from test webhooks. But when I use a real account to send messages or some acctions to my page. Nothing happened in my webhook.
Here's is my simple code in my webhook.
#csrf_exempt
def WebhookPAGEAPI(request):
event_json = json.loads(request.body)
print(event_json)
return HttpResponse('OK',status=200)
I tried enable live mode but still failed.

verify FCM registration token using python

I have Firebase Cloud Messaging registration token from client. and i want to verify this registration token before I send push notification.
btw, I have tried https://firebase.google.com/docs/auth/admin/verify-id-tokens but I think this is for Auth tokens not for push notification.
how to verify registration token before send push notification ?
You cannot verify FCM registration token generated from device. Auth token created by firebase auth is JWT token which can be verified.
To verify if the token is generated from your client and project, you can send a test notification with your server key and check the response message, if token is altered obviously it will give you relevant error.

AWS Pinpoint - Unregistered Application. Pinpoint is not registered in PNS

We have registered FCM server key on Pinpoint. We were able to successfully receive messages on our emulator when tested with Cloud Messaging on Firebase console. However, when we are trying to send push notification using GCM channel of 'sendUsersMessages' API - we receive below error for endpoint
"DeliveryStatus": "PERMANENT_FAILURE",
"StatusCode": 404,
"StatusMessage": "{\"errorMessage\":\"Unregistered Application\",\"channelType\":\"GCM\",\"pushProviderStatusCode\":\"0\",\"pushProviderError\":\"a153cc45babasomepinpointid67073b-gcm#Pinpoint is not registered in PNS.\"}"
What does this error mean? Does it mean our Pinpoint application is not registered on Firebase? Or our device doesn't have token? or something else. Couldn't find any answers. Please help
After some play around - figured out that I was using RestrictedPackageName matching my application's FCM console package name (like com.xyz.app.abc) - I removed that and push notification went through successfully.

AWS Lex and Facebook Messenger Integration Not Working

I'm banging my head against the wall trying to get an AWS Lex based chatbot integrated with Facebook.
As far as I can tell, everything is set up correctly.
When I send a message to my page in Facebook, I don't get a reply. However, the analytics in my app shows that the app is getting messages, so I know the message is making it from the page to the app.
When I try to hit the AWS Lex Webhook directly using POSTMAN, the webhook responds to literally everything I sent to it with a blank HTTP 200 OK response.
The lambda function that is tied to the AWS Lex chatbot is not getting invoked as a result of the messages from Facebook because no logs are getting generated and cloudwatch doesn't show an attempts to run the lambda function.
Does anyone have any ideas?
UPDATE : I ended up engineering around this by bypassing the Facebook channel capability inside AWS Lex and using Lambda instead. I deployed a passthrough API which calls a lambda function and then interacts with AWS Lex via Boto3/Python. In theory this is all supposed to be taken care of from inside AWS Lex with the Facebook channel integration, but I wasn't able to get it to work so I just built around it.
Verify Amazon lex is properly configured with facebook messenger .
Check : Page access token
Verification token
App ID
Check if your webhook is subscribed to page you are messaging on.
Check if your facebook user is added as tester/admin/developer
Check if your latest version of BOt is published on intended alias.
Also while configuring webhook tick necessary options : messages, messaging_postbacks, messaging_optins, message_deliveries, message_reads, messaging_payments
This should resolve your head ache. If not please reply

Why can I invoke my API Gateway endpoint from terminal but not from Braintree's console?

I have an API Gateway that invokes a lambda function. I deployed the gateway and am succesfully invoking the function from my terminal by sending a POST request to the endpoint. I do this like so:
curl -H "Content-Type: application/json" -X POST -d "{\"bt_signature\":\"curl\",\"bt_payload\":\"abcsdsddsd\"}" https://*myendpointurl*
When I enter this endpoint in my Braintree console though as a webhook url though and click "check url" i get the following error pop up:
Last delivery unsuccessful. Invalid server response 400
It is weird that it works when I invoke it from my terminal but not here. Futhermore when i enter my endpoint for the method in my web browser it turns up with this error message:
{"message":"Missing Authentication Token"}
I have double checked I am using the write endpoint for this specific POST method. It's just weird that it works from terminal but not as a webhook url in braintree. Ideas?
The reason you get "Missing Authentication Token" when hitting from the browser is because the browser will make a GET request, whereas your API is setup for POST method. API Gateway will respond with a "Missing Authentication Token" when you make requests for non-existent resources/methods. (It's possible Braintree is also generating a GET request internally, but I would recommend you check with their support for confirmation.)
Hope this helps,
Ritisha.