Api version change but docs not updated? - ms-office

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

Related

AzureMfaProtocolProvider - UserMessageIfBadReputation

As part of MFA in a custom policy we're using AzureMfaProtocolProvider to send one-time codes via SMS.
For some users we're seeing the following error:
{
"Key": "Exception",
"Value": {
"Kind": "Handled",
"HResult": "80131500",
"Message": "ErrorCodes: UserMessageIfBadReputation",
"Data": {
"IsPolicySpecificError": false
}
}
}
I can't seem to find any information regarding this error in the docs.
How can I figure out what triggers this and why it was triggered for that specific user?
PhoneReputation service is integrated with Azure MFA to provide a near-real time determination which tracks tracks the usage and reputation of phone numbers as they are used across various Microsoft services.
Any particular browser user agent having the issue, few days back i worked on a similar issue where latest version of firefox reported this kind of issue reference: https://learn.microsoft.com/en-us/answers/questions/1090554/azure-b2c-unblock-phone-number.html?childToView=1097185#comment-1097185
Also where are the users located who reported this error ? any specific region/country code users reported this issue.

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.

Update message card in Teams via webhook connector

I have a build machine from which I want to post updates in Microsoft Teams. I created a webhook connector for my channel in Teams and I can send a simple POST request to the webhook url to post a message card in Teams with this json payload:
{
"#type": "MessageCard",
"#context": "http://schema.org/extensions",
"summary": "Build Status",
"sections": [{
"facts": [{
"name": "Status",
"value": "<build status>"
}]
}]
}
Now I want to update the <build status> value as the build progresses and maybe add another fact with download link when the build is finished. Is it possible to update an existing card once it is posted? It seems like a common use case to me, but I was not able to find an answer to it. There are some blogs about updating card as a result of an action, but I don't have or want to have any actions. And obviously I don't want to keep adding cards for the same build process.
Currently update card via web-hook is supported in teams. Could you please Raise a user voice
Sorry, I jumped the gun on that. It appears it isn't supported from webhooks.
https://techcommunity.microsoft.com/t5/microsoft-teams/refresh-cards-not-working-in-teams/m-p/93282

I'm trying to receive a webhook from an Autodesk Forge workflow.transition event but they aren't firing

I've been experimenting with the Fusion Lifecycle webhooks in Forge and have been successful using the item created/updated events but the workflow transition webhooks aren't firing.
The webhooks are created in Forge according to the Docs, as you can see below, but none of the transitions performed in the workspace will trigger the call.
They were created using a three-legged token associated with a Fusion Lifecycle user that has the proper workflow permissions on the workspace.
The following JSON excerpt is the workflow. transition webhook as returned from developer.api.autodesk.com/webhooks/v1/hooks endpoint on Forge showing it was indeed created.
​
{
"hookId": "909fd040-4e34-11ea-a842-651c9013b5e8",
"tenant": "TENANTNAMEREMOVED4SO",
"callbackUrl": "callbackurl removed for SO",
"createdBy": "46FGNL6DBN6D",
"event": "workflow.transition",
"createdDate": "2020-02-13T07:43:45.988+0000",
"system": "adsk.flc.production",
"creatorType": "O2User",
"status": "active",
"scope": {
"workflow.transition": "urn:adsk.plm:tenant.workspace.workflow.transition:TENANTNAMEREMOVED4SO.119.1.765"
},
"hookAttribute": {
"creator": "D3 Forge Playground",
"notification": {
"class": "alert-danger",
"system": "flc"
}
},
"urn": "urn:adsk.webhooks:events.hook:909fd040-4e34-11ea-a842-651c9013b5e8",
"__self__": "/systems/adsk.flc.production/events/workflow.transition/hooks/909fd040-4e34-11ea-a842-651c9013b5e8"
}
I've pushed the workflow through the transition events numerous times and no webhook is being fired and no failed requests on our webhook receiving server either. if I mimic the payload for the workflow. transition event and post it to our endpoint, it is received as expected.
I have yet to see a live example of the workflow. transition webhook being fired and can't find any sample code from Autodesk using them. Not sure the service is even working as expected at this point even though the item.created and item.updated webhook events seem to work fine.
Has anyone successfully received a workflow. transition webhook from Autodesk Forge? If yes, could you provide some guidance on how?
Seems to be working fine on my end in a Production tenant. This is the payload I used to create the webhook:
{
"callbackUrl": "https://webhook.site/SOME_ID",
"scope": {
"workflow.transition": "urn:adsk.plm:tenant.workspace.workflow.transition:TENANT.107.1.421"
}
}
Does it look like the payload you used when creating the hook?
Greg, any chance you can try to trigger it again, and send me the date/time stamp with tenant name via a private message? I just tried it again in my Production tenant, and it seems to be working just fine when I perform the operation from both a v3 API call, and the UI. Feel free to file a support case if you want, too, and let me know the case number. I'd like to help you out here in understanding what's going on, because overall it looks OK from your side.

How can I request the user's location in API.ai?

I'm creating an agent using api.ai and using a PHP script as a webhook. The documentation doesn't make it clear on how to do it, but I'm wanting to request permission to the user's coarse location so they won't have to provide their location for requests.
I've tried echo-ing the JSON they mention, and putting it in as a custom payload for the default welcome intent, but neither of those seem to prompt me for permission to use my location.
How do I ask a user for permission to get their location?
EDIT: If I set my PHP script to respond to intent.welcome with the following JSON:
{
"data": {
"google": {
"expectUserResponse": true,
"systemIntent": {
"intent": "actions.intent.PERMISSION",
"data": {
"#type": "type.googleapis.com/google.actions.v2.PermissionValueSpec",
"optContext": "To provide an accurate experience, ",
"permissions": ["DEVICE_PRECISE_LOCATION"]
}
}
}
}
}
The app asks me "To provide an accurate experience, , I'll just need to get your street address from Google. Is that ok?"
However if I say "yes", then the app keeps asking things like "Sorry, could you say that again?", so I can't actually get it to do anything.
You need to create a new Intent with the Event set to actions_intent_PERMISSION. (See image below.)
When this Event is triggered, your webhook will be called with the JSON originalRequest.data.device.location field in the request body populated with the location information you've requested.

Resources