After successfully subscribing to Microsoft graph notifications with application I receive no notifications - rest

I'm trying to receive notifications from Ms Graph. I want to create background service/daemon which connects to Graph with its own identity.
I'm using developer account. I've successfully created an application in AAD. I've added necessary permissions to my app.
For simplicity I'm using Postman to make REST requests to Graph. I've successfully authenticated with my app via:
https://login.microsoftonline.com/{mytoken}/oauth2/token
And received Authorization token. I can successfully execute Graph queries, like read and write messages of all users.
https://graph.microsoft.com/v1.0/users/93ffed3b-5aec-458c-a5eb-691cd610cd50/messages
I've created 2 subscriptions. And I can see those in a list.
https://graph.microsoft.com/v1.0/subscriptions/
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#subscriptions",
"value": [
{
"id": "67d395ae-0fad-438e-8f23-175dd2b43172",
"resource": "/users/93ffed3b-5aec-458c-a5eb-691cd610cd50/mailfolders('inbox')/messages",
"applicationId": "991ead1f-14b0-4934-a471-c749edcbb352",
"changeType": "created",
"clientState": null,
"notificationUrl": "https://831327fd.ngrok.io/notification/listen",
"expirationDateTime": "2018-12-13T23:00:00Z",
"creatorId": "fc01f0e2-2b2c-4dc1-a18c-75529fb75953"
},
{
"id": "75b01b91-6595-4ce0-98b3-772731071607",
"resource": "/users/93ffed3b-5aec-458c-a5eb-691cd610cd50/messages",
"applicationId": "991ead1f-14b0-4934-a471-c749edcbb352",
"changeType": "created",
"clientState": null,
"notificationUrl": "https://831327fd.ngrok.io/notification/listen",
"expirationDateTime": "2018-12-13T23:00:00Z",
"creatorId": "fc01f0e2-2b2c-4dc1-a18c-75529fb75953"
}
]
}
I'm using ngrok to tunnel requests to my local dev environment.
I've send several emails to an account which I subscribed to in subscriptions. But I've received no notifications.
How can I troubleshoot it? Is there a problem on MS Graph side, was it attempting so send me Notifications Or not? Is there a problem with my account or application configuration?
Today I see notifications about yesterdays' emails. For some unknown reason I received notifications after several hours. But question remains. Is there a way I can troubleshoot Notification scenario and see why MS Graph did not sent them to me?

After several hours everything started to work properly. It seams there is some internal stuff in MS Graph or Azure that after you create an Application and subscribe via it to emails, it's not starting to work instantly.

Related

Why is PayPal REST api pay by credit card option showing on desktop, not showing on mobile?

After a lot of digging around I have finally managed to get something working with the PayPal REST API, the documentation is awfully confusing.
I'm creating a C#/MAUI mobile app where I need to take payments.
Anyway, I managed to get the PayPal API it to create this URL, below (I can simulate the same thing using Postman)
https://www.sandbox.paypal.com/checkoutnow?token=XXXXXXXXXXXXX
Get an access token (access_token) using the REST API
POST to https://api-m.sandbox.paypal.com/v2/checkout/orders/ this payload
{
"intent": "CAPTURE",
"purchase_units": [
{
"reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b",
"amount": {
"currency_code": "USD",
"value": "100.00"
}
}
]
}
The returned payload gives me this json. There are other kinks in the returned payload but this is the one I need.
{
"href": "https://www.sandbox.paypal.com/checkoutnow?token=XXXXXXXXXX",
"rel": "approve",
"method": "GET"
}
Using that URL, on a desktop PC browser I get the option to log-in or "pay by debit or credit-card" but on mobile browser I only get the option to create an account or log-in to an existing account, using that exact same URL.
Does, anybody know whats going on here? How do I get the same options in a mobile browser. I can't find anything in the documentation that explains this behaviour.
Guest availability in the paypal.com checkout depends on very many factors, including the IP address and geographic location of the buyer, the amount of the transaction, the device used, and any number of other things. Other than disabling guest as a possibility in your account options, you cannot control this behavior of the PayPal page.
A 'Debit or Credit Card' button on your own page can be added using the JS SDK for approval, rather than redirecting away. Here is a demo, which would fetch the created order id/token from your server.

Using different phone numbers in whatsapp business api account

Following to this documentation https://developers.facebook.com/docs/whatsapp/business-management-api/phone-numbers about whatsapp business accounts, it is possible to have multiple phone numbers in one account. Does someone know how you can define from which number a message is send, when sending a message to a client?
There is nothing in the api about sending messages.
following to the documentation you can read the phone numbers and their whatsapp id via
curl -X GET \
'https://graph.facebook.com/v3.3/your-whatsapp-business-account-id/phone_numbers' \
-d 'access_token=your-access-token'
example result
{
"data": [
{
"verified_name": "Jasper's Market",
"display_phone_number": "+1 631-555-5555",
"id": "1906385232743451",
"quality_rating": "GREEN"
},
{
"verified_name": "Jasper's Ice Cream",
"display_phone_number": "+1 631-555-5556",
"id": "1913623884432103",
"quality_rating": "NA"
}
],
}
I would expect something like a senderId field when sending a message.
There are two parts to a WhatsApp Business API - WhatsApp Account on Business Manager (Facebook), and WhatsApp Business API Client (docker images).
What you're looking at is the WhatsApp account information from Business Manager.
Once you've added a phone number with a verified_name, you need to download the certificate from Business Manager and use that certified to register your WhatsApp Business API client (docker containers).
Each client is registered with a specific phone number, so you know what phone number you're using to send the messages.
This is equivalent to having a separate cell phone for every separate phone number and WhatsApp app on that cell phone.
Follow the official WhatsApp documentation, to get more detailed information about the setup.

Jawbone: Registered Webhook not being called

I've just started looking at the Jawbone API so please forgive any rookie mistakes.
I've successfully navigated OAuth and I'm now able to pull data from endpoints. I've registered a webhook for my server at https://example.com/webhook.php and I got a success message
{"meta":
{"user_xid": "<redacted>",
"message": "Registered webhook for user",
"code": 200,
"time": 1469983151},
"data": {}
}
However, I can't see the webhook being called at all. None of the code within the script seems to be running, so I've looked in the webserver logs and there are no requests happening in there.
I've tried adding and deleting moods in the app to get something to happen, and tried syncing the jawbone itself and nothing seems to get the webhook to fire.
My API application isn't published (yet), I hope that's not a barrier here, because I want to test thoroughly first. Is there another step I'm missing?
Thanks in advance!

How to send Message object with Box.com's Collaborate Rest API Call?

I am trying to attach message object to "Create Collaboration" API Call. I am able to successfully invite a user to collaborate and the user receives the email but don't see the message in the invite email. My sample request below:
{"item": { "id": "5497784333", "type": "folder" }, "message": "This is a test message", "accessible_by": { "login": "johnxxx#gmail.com", "type": "user" }, "role": "editor"}
There is no documentation in the create collaboration API, but the BOX Web Application somehow accepts message and displays in the email. Could someone please help to determine if there is a way to send message object in the Rest API Call?
Thank everyone in advance.
Adding a message to the collaboration email invite is not currently supported through the Create Collaboration API.

FB user with 2 ad accounts, but the AdUser can't see it

I'm using Ads Api with this call in order to get the ad accounts:
me/?fields=adaccounts
I see one account with this result:
{"adaccounts": {"data": [{"account_id": "1234567", "id": "act_1234567"}],
"paging": {"cursors": {"after": "NjAxNDA2OTk5Mzg3Ng==", "before": "NjAxNDA2OTk5Mzg3Ng=="
}}},
"id": "111111"}
But, when our client uses ads manager he can see two accounts. The one from this result and another one.
Our client told me that this user has advertising permissions to the second account.
How can it be? am I missing something? why can't I see both adaccounts?
Thanks.
Apparently, when we generated a new Access Token for this user the problem solved and we were able to see the second ad account.