Activity sent to external tenant throws error - microsoft-graph-api

Issue Description :
Through the app, we send activity notifications to users feed., When we send activity in the same tenant, it works, But when activity is sent to an external tenant then it throws the below error from graph API
API used :
https://graph.microsoft.com/beta/teams/<team_id>/sendActivityNotification
where -> <team_id> is team id of external tenant
Error Message :
ERROR -> b'{"error":{"code":"Forbidden","message":"Sender of notification does not have access to the team 'fe51246f-1a2c-4af7-956f-7b124431bd31'.","innerError":{"date":"2021-10-21T09:43:55","request-id":"8c9b082c-40e6-4dea-999e-f60163060aa5","client-request-id":"8c9b082c-40e6-4dea-999e-f60163060aa5"}}}'
Please suggest ways to implement above.

Related

Microsoft graph api throws The mailbox is either inactive, soft-deleted, or is hosted on-premise while creating event

I want to create meeting event. I have added user in azure ad and also assigned delegated permission Calendars.ReadWrite.
But while creating event by following lines it throws error:
var response = await graphClient.Me.Calendar.Events.Request().AddAsync(#event);
Code: MailboxNotEnabledForRESTAPI
Message: The mailbox is either inactive, soft-deleted, or is hosted on-premise.
Here I found answer from Microsoft :
https://learn.microsoft.com/en-us/answers/questions/761931/microsoft-graph-api-throws-the-mailbox-is-either-i.html

How to invite a user from tenant B to a group call with calling bot for a meeting organized by user from tenant A?

I have created a Calling Azure Bot which is registered with tenant A. The bot got admin consent from tenant B to make/join calls (Application permissions: Calls.AccessMedia.All, Calls.Initiate.All, Calls.InitiateGroupCall.All, Calls.JoinGroupCall.All, Calls.JoinGroupCallAsGuest.All, OnlineMeetings.Read.All and OnlineMeetings.ReadWrite.All).
When a user of tenant B schedules an online meeting, I'm able to join this meeting with my bot from a small .NET app using the Microsoft.Graph, Microsoft.Graph.Communications.Calls and Microsoft.Graph.Auth NuGets.
I'm also able to invite additional participants from tenant B to the ongoing meeting with Graph API /communications/calls[<callId>]/participants/invite. But when I try to invite a user from tenant A or any other tenant, the call to invite fails with the following error:
Error occurred: Status Code: Forbidden
Microsoft.Graph.ServiceException: Code: 7505
Message: Request authorization tenant mismatch.
Why does this error occur and how can I fix it?
Does the Graph API support this scenario at all?
If not, are there any plans to support it in the future?
Any help would be very much appreciated.
Seems like this is not supported by Microsoft and there are also no plans to support it in the near future. See https://github.com/microsoftgraph/microsoft-graph-comms-samples/issues/144

create subscription for a shared mailbox

I would like to create a subscription for incoming mails on a shared mailbox with Microsoft graph.
Background:
I have an app created with delegated user rights:
Read all webhook subscriptions (preview)
Read and write user mailbox settings
Read and write user and shared mail
I have created a shared mail box
I have added a user to that shared mailbox.
I have added the shared mailbox to the users folders so I see users mailbox and the shared mailbox in the WEB GUI
I have created a c# program to receive auth token, created subscriptions and listed messages from a mailbox
What works:
Receiving auth token
List messages of users mail box
List messages of shared mailbox
Create subscription on users mail box
It does not work if I try to create a subscription for incoming mails
in the shared mail box.
My resource string during creation of the subscription is:
Resource = users/xx#xxx.onmicrosoft.com/mailFolders('Inbox')/messages
As said works well with the users mail address but fails using the shared mail box address:
{
"error": {
"code": "ExtensionError",
"message": "Operation: Create; Exception: [Status Code: Forbidden; Reason: Forbidden]",
"innerError": {
"request-id": "xxxxx-8515-4048-8c05-f3eb91a1f69a",
"date": "2018-12-13T15:17:09"
}
}
}Subscription failed because:Forbidden
Did I use the wrong resource string here or did I miss an app right here?
according to
[Microsoft comunity][1]https://answers.microsoft.com/en-us/msoffice/forum/all/new-email-notification-for-shared-mailboxes/356cca22-6b23-440c-84a4-3a7b1c4021ad
this will never work
This is 'expected behavior' for shared mailboxes- you'd need to add it as an account, not a shared mailbox, to get notifications. You could use macros to watch the inbox and alert you when a new message arrived.

Get "Target URL ... is not allowed" error message when actioning Outlook actionable message for external email user

We're developing a connector that creates actionable outlook messages for external users. I.E. This is a service. Can anyone please help with the below example? We're getting an error for the external users when they try to action the message by clicking on one of the action buttons.
Example:
User A is on the tenant that registered the connector - Tenant A,
User B is on another Office 365 tenant, Tenant B.
We've created an Office 365 connector targeting the user's "Inbox"
The connector has not been published to the store but is still in dev.
So to be clear we're not implementing our solution using "Actionable Email".
We can create the actionable message for both User A and B, no problems so both users get the email. But only User A ( on the tenant that registered the connector ) can click an Action button from Outlook. User B gets the error message:
"Target URL 'https://nameomitted.com/method' is not allowed"
We are not receiving anything at our web server end from the call. The console error from the browser when clicking the action button is:
So the error is generated from Microsoft internally.
Can we only send to users in the same tenant as the one that registered the connector until we've published to the store? That seems restrictive for development.
Any help is greatly appreciated.
Is your connector's registration pending or approved?
Pending connector's functionality is limited. Most cross tenant operations are blocked.
In my case, I was using a different URL which was not registered in the Provider. If both the end points (in the provider & in the Adaptive Card JSON) match, then only it will work.

Error message when linking an app to QBO

When a client clicks on our QBO connect link, they get redirected to log into QB, which the client does and they get the following error message:
Oops! An error has occurred.
Please close this window and try again.
Error Code: invalid_database
Message: The application has already been subscribed to by another user for this company
What could be causing the message?
The error message is telling you exactly what the problem is:
The application has already been subscribed to by another user for
this company
Another QuickBooks user has already subscribed (connected) to the app. Why are you allowing/trying to reconnect if another user has already connected?

Resources