Whatsapp Cloud API webhook not sending back the messages object - webhooks

One of my WA cloud Apps suddenly stopped working,
I went to the webhook and it is not sending the messages object back,
I am sure this happened suddenly
here is the result from webhook:
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "1900820329959633",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "16315551234",
"phone_number_id": "16315551234"
},
"statuses": []
},
"field": "messages"
}
]
}
]
}
Meanwhile if you go to official WA Postman collection you will find that it already includes messages object.
Edit 1:
After some investigation I found that developer.facebook health check page has the following:
But still not sure if that's related.
Is there anything I can do to fix this?
Edit 2:
I tried another developer account that has cloud API, it works and sends back the messages Object correctly.
EDIT 3:
Now they are describing the same issue occurred.

I have been able to report a bug to WA Team, and they were able to reproduce the error.

Related

MS Bot Framework Direct Line API 3.0: Get starting message

I published a bot using the Azure bot framework to the Azure cloud servers, and made an application that uses the Direct Line API 3.0 to send user responses and receive bot messages through HTTP requests. Everything works except that I'm not sure how to get the starting message of the bot at the start of the conversation. I open the conversation with the /v3/directline/conversations endpoint, but I'm not sure how to receive the first message of the bot (that is normally sent without any user interaction). A message request after opening the conversation doesn't include any bot responses, but the next message request after sending the first user input includes the first two messages of the bot (starting message and response to the user).
EDIT: From reading this I came to the conclusion that it will be easier to just use a custom event as a trigger for the welcome message. I updated my bot as follows to reflect this within bot composer, adding a new CUSTOM event trigger with a test response message:
However, I still can't seem to trigger this event via the Direct Line API. Currently, I send a request as follows, following the event activity structure:
{
"type": "event",
"channelId": "directline",
"from": { "id": "UnityUserId", "name": "Unity User 1" },
"value": "test",
"name": "welcome"
}
I then get a response with ID, normally indicating that the request was successfull. However, upon requesting the bot response messages, I get the following:
{
"activities": [
{
"type": "event",
"id": "5FZsHpWBxm1hjhWQYY7gr-eu|0000000",
"timestamp": "2022-04-09T14:39:15.90169Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "UnityUserId",
"name": "Unity User 1"
},
"conversation": {
"id": "5FZsHpWBxm1hjhWQYY7gr-eu"
},
"value": "test",
"name": "welcome"
}
],
"watermark": "0"
}
Indicating that the bot has no responses, which doesn't seem quite right when looking at the bot composer screenshot above. Is there something wrong with my current method?
Regards
The onMembersAdded event usually does the trick. Sample code is in https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-send-welcome-message?view=azure-bot-service-4.0&tabs=csharp
I thought I remembered seeing the bot's welcome message when using Direct Line, so I tried to quickly repro it again. I connected a simple echo bot via Direct Line. Then I created a conversation, sent a simple message, and then retrieved all activities (all via REST calls), and the bot's welcome message was indeed present in the response, as you can see in this screenshot:
Perhaps you should use these Direct Line 3.0 API reference docs as opposed to the one you linked above. I followed these steps using the basic Echo bot sample, Postman, and a bot resource in Azure for simple and easy testing, but you could use a full application if you wish.

Jira registration of webhook via REST API

I've looked through every similar topic here in the forums, and couldn't really find anything that would help me.
I've built 3LO integration with my product, and trying to add webhooks via rest API. The first Hook is created successfully, how ever if I tried to create another hook for another user on the same App I get this message.
"webhookRegistrationResult": [
{
"errors": [
"Only a single URL per app is allowed to be registered via REST API. Currently used URL: https://example.com/api/webhooks/jira"
]
}
]
and my request is:
POST https://api.atlassian.com/ex/jira/{cloud-Id}/rest/api/3/webhook
{
"url": "https://example.com/api/webhooks/jira",
"webhooks": [
{
"jqlFilter": "status = Done or status != Done",
"events": [
"comment_created",
"comment_updated",
"jira:issue_created",
"jira:issue_updated"
]
}
]
}
I want to create a webhook for each user associated with my App to get any updates in issues or comments related to this user.

Requesting User Location from Google Actions with Api.ai

Google Actions can provide you with the user's location, name, and few other details. How can this be done on Api.ai without the nodejs SDK? All examples from Google are using the Nodejs sdk.
According to the Conversation Api it is just a matter of putting the correct json in the response, however it is unclear how to get Api.ai to fill in this json.
I've read the docs here , but am still unclear.
Sample code, or more detailed documentations, would be great for the non nodejs developers. I'm working in Java, however a good explanation of how Api.ai builts the response json for Google Actions would be helpful for developers of all languages.
You have to study the API.AI HTTP API here. As a reference, try to setup the node examples - this way you can see the JSON files in action.
For the permissions try the Name Psychic example.
Your outgoing JSON will be something like this:
{
"contextOut": [
{
"lifespan": 100,
"name": "_actions_on_google_",
"parameters": {}
},
{
"lifespan": 1,
"name": "requesting_permission",
"parameters": {}
}
],
"data": {
"google": {
"expect_user_response": true,
"is_ssml": false,
"no_input_prompts": [],
"permissions_request": {
"opt_context": "To send you something",
"permissions": [
"DEVICE_PRECISE_LOCATION"
]
}
}
},
"speech": "PLACEHOLDER_FOR_PERMISSION"
}
There is now another option for Java programmers working with Actions on Google. There is an open source port of the official SDK to Java/Kotlin. API is very similar, so for location it would be something like:
app.askForLocation()
https://github.com/TicketmasterMobileStudio/actions-on-google-kotlin

Instagram Subscription

I have followed Instagram documentation (https://www.instagram.com/developer/subscriptions/) on how to create a user subscription.
This is the response that I get after creating the subscription:
{
"meta": {
"code": 200
},
"data": {
"object": "user",
"object_id": null,
"aspect": "media",
"subscription_id": 0,
"callback_url": "http://CALLBACK_URL",
"type": "subscription",
"id": 0
}
}
Some of the users that have authenticated with my app have posted some media and yet I'm not seeing anything from my end, which makes me think that there might be an error with the subscription.
subscription_id or id 0 does not look correct to me. My app is still in Sandbox mode, is this the problem?
Also, I have tried creating another subscription with object=tag and object_id=blah but it returns the same response as above.
Any advice would be very much appreciated. Thank you!
The subscription_id=0 looks weird but it's normal in sandbox. Perhaps you can make sure your callback url is actually receiving the post from Instagram properly (save it to a log to test).

Api version change but docs not updated?

I've been trying to do various things through your Mail REST API today and not having much success... My project (using the api) has been running for at least a month now, but requests to your api are failing.
For example:
GET https://outlook.office365.com/EWS/OData/Me/messages (works)
GET https://outlook.office365.com/EWS/OData/Me/inbox (doesn't work)
Looking at the documentation, still says its available.
Trying to send an email using:
POST https://outlook.office365.com/EWS/OData/Me/Messages?MessageDisposition=SendAndSaveCopy also just returns 400 (Bad Request)
Any info about this?
Also, the http status codes returned are not useful at all; almost all errors return as 400's. In one instance, I didn't provide auth creds, and a 400 was returned instead of the appropriate 401. The accompanying status code detail could also be more helpful.
Thanks for the feedback and sorry for the inconvenience. We are currently deploying some non-backwards compatible changes described here, and this is causing your issues. The current set of changes including versioning support, and deploying non-backwards compatible changes won't cause issues for your app in the future. For the queries, that don't work, please use the following:
Accessing Inbox: https://outlook.office365.com/ews/odata/me/folders/inbox
Send email (new action called SendMail):
POST https://outlook.office365.com/ews/odata/me/sendmail
{
"Message":
{
"Subject": "Test message",
"Body":
{
"Content": "This is test message!"
},
"ToRecipients":
[
{ "EmailAddress": { "Address": "John#contoso.com", "Name": "John Doe" }},
{ "EmailAddress": { "Address": "Jane#fabrikam.com", "Name": "Jane Smith" }}
]
},
"SaveToSentItems": true
}
Hope this helps. We are updating the documentation to reflect the changes, and it should be available shortly. Thanks for the feedback on the HTTP status codes, we will review the status codes returned currently and make any fixes required.
Conversation support is in our roadmap but we don't yet have a timeline to share. Currently, you can search using https://outlook.office365.com/ews/odata/Folders/FolderId/Messages?$filter=ConversationId%20eq%20%%27ConversationID%27 but this will only return messages within the specified folder belonging to that conversation.
Let me know if you have any questions or need more info.
Thanks,
Venkat

Resources