Inviting Friends on Event throws OAuthException - events

I am trying to invite the friends of the logged in facebook user to a certain event by using following code:-
FB.ui({method: 'apprequests',
message : user.name + " has invited you to an event",
title : "Invite friends to go along with you",
},function(response){
for(i=0;i<response.to.length;i++){
FB.api('/'+eventId+'/invited/'+user.id,'post',function(resp){
alert(resp);});
}
});
But I am receiving this error
error:{"message":"(#200) ","type":"OAuthException","code":200}
I have create_event, manage_pages, publish_stream, photo_upload permissions from the user. Could anyone provide me pointer where I am going wrong.

This is a bug.
https://developers.facebook.com/bugs/312375168858626?browse=search_5017eadead76b7a22667493
Facebook addresses bugs when developers complain about them. At the link above you should report that you are experiencing the same problem as the author.

Related

How do I send a message to myself with PowerAutomate?

I am developing a PowerAutomate flow,
I want to use the function "post message in chat or channel",
I can send messages to anyone in "one to one" private chats but not on the private chat i have with myself.
Has somebody found a way to message himself via power automate?
I can't create it as a "new chat" in PA because it says users cannot be duplicate.
Then i figured out i had to find the ID of the chat with myself.
I tried using the microsoft graph api to retrieve the id from "me/chats" but the chat with myself is not shown.
I tried many different filters and expansions with no success.
I also tried analyzing the id itself and discovered that, in the case of "one to one" chats, it's made of {the sender id} and {the receiver id}
I then tried constructing an id that contains 19:{myuserid}_{myuserid}#{domain} but it responds that there is no record.
I tried many combinations,
thanks for the help.
Currently it is not possible to send messages/cards to self chat as the self-chat id is not exposed.You can raise suggest this feature at Microsoft Teams Feedback portal.
Please not that if you post card using below settings it will send a card to you but as a separate chat with Power Automate.

Google Calendars API - Insert Event - Notify organizer by email

Using Google Calendars API /events/insert, I create an event in a user's calendar on their behalf and set them as the organizer. I also invite one guest.
I want the organizer to receive an email notification similar to what a guest might receive. I tried using the sendUpdates parameter but it only notifies guests.
Is there a way to notify the organizer that an event was created in their calendar on their behalf?
That is outside of what even Google Calendar can do. So this problem is unrelated to the API itself. Google calendar assumes that the organizer is the one creating the event so already knows it is being created so there is no reason to notify them.
You have access via Oauth2, there is no way the api knows that this is not the user themselves as your application has permission to preform actions on behalf of the user. So google calendar thinks you are the user so no reason to notify you.
Here's a work around I have used in the past.
As you already have write access on the calendar you should have access to see who the owner is by doing an acl.list this will get you their email address.
You could then have your application email them.
You can also invite them using an allies email address, however i have found some clients don't like this solution as they then appear twice.
One work around you can do is to add a another version of the owners email to the attendees. For example, if their normal email is test#gmail.com you can convert it to test+1#gmail.com. They'll receive an invite at their normal email. Keep in mind this will add an additional attendee to the event. When they click accept in the email it will mark their original email as accepted, not the one with +1 appended to it.
See this basic function for adding a +1 the email in JS:
function changeEmail(email) {
let splitEmail = email.split('#');
return splitEmail[0] + '+1#' + splitEmail[1];
}
Note you can add any text after the email. It doesn't have to be +1.
Answer:
As DaImTo has said, the API will not provide an email to the user who has created the event, which is exactly what your application is doing via OAuth2.
You can however take the event information from the response and manually send the user an Email using the Gmail API.
Example Code:
I do not know what language you are using, but as a python example, after getting the Gmail service with your service account credentials:
subject = "email#example.com"
delegated_credentials = service_account.Credentials.from_service_account_file(key_file_location, scopes=scopes, subject=subject)
gmail_service = discovery.build(api_name, api_version, credentials=delegated_credentials)
You can use the Sending Email tutorial to create and send an email on behalf of the user that created the event:
# Copyright 2020 Google LLC.
# SPDX-License-Identifier: Apache-2.0
def create_message(sender, to, subject, message_text):
message = MIMEText(message_text)
message['to'] = to
message['from'] = sender
message['subject'] = subject
return {'raw': base64.urlsafe_b64encode(message.as_string())}
def send_message(service, user_id, message):
try:
message = (service.users().messages().send(userId=user_id, body=message)
.execute())
print 'Message Id: %s' % message['id']
return message
except errors.HttpError, error:
print 'An error occurred: %s' % error
And then simply send the information to the user via email using the data already defined for the event insert call:
emailText = "Title: " + summary + "\nStart: " + startTime + "\nEnd: " + endTime
msg = create_message(subject, # the sub for the service account
subject, #to and from are the same
"A Calendar Event has been created on your behalf",
emailText)
send_message(gmail_service, calendar_response['creator']['email']
References:
Sending Email | Gmail API | Google Developers

google classroom Invitation accept method return a NOT-FOUND

I have invited a google account as a student to my course and listing the invitations using LIST method returns the invitationId , courseId , Role(Listing is done from the senders google account). But if i accept the invitation from the invited users account with the invitation id.
It returns the following :
"error": {
"code": 404,
"message": "Requested entity was not found.",
"status": "NOT_FOUND"
}
}
I am also not able to GET the invitation from the invited users account.
I am able to GET the invitation only from the senders account.
what is the issue I am facing and how can i solve it?
You have to edit the Class membership settings in your Google Admin. It's probably configured to only allow users in your domain.
To change this, go to your Google Admin console and then Apps > Additional Google services > Settings for Classroom > Class settings and in "Who can join classes in your domain" set it to "Any user"
Take into account that changes can take 24h to propagate to all users.

retrieve members email from 1:1 conversation bot framework message extension

So i created a message extension using bot framework v4.
What am trying to do is to retrieve members emails in 1:1 conversation using the message extension on OnTeamsMessagingExtensionSubmitActionAsync. However am getting 403 Forbidden.
The next step I tried to add the Bot to the conversation using AdaptiveCards and I get the following error "Something went wrong, please try again later." And when checking bot in channel registration I found the below issue:
The bot is not part of the conversation roster
So I created a graph connection and granted admin consent.Now when using GetUserTokenAsync after submit action I receive "Something went wrong, please try again later." (Testing connection created from portal.azure.com returns a token)
I find it a little bit weird to not able to retrieve what's already obvious. I can see the contact email and name so the 403 is absurd in my own opinion or I might be doing something wrong.
SO my question is either how to check the detailed errors that are returned or is there any easier way to retrieve members emails.
Thank you
So the problem was in the bot manifest file it seems that I didn't add the below to the json:
"validDomains": [
"token.botframework.com",
"*.ngrok.io"
]

error : { "code": "MailboxNotEnabledForRESTAPI", "message": "REST API is not yet supported for this mailbox." }

I am new with the "outlook" api. i want to get all calender event,contact and mail from "outlook account".
but i does not get appropriate result with "outlook" account its working fine with "office365" account
i follow this documentation for get all required data
and i create application for getting data from here
but every time when i login with my outlook account it's give me an error like this.
Please help me out.
Thanks in advance...
Just ran into the same problem and found an explanation here. It appears we're going to have to wait for the accounts to be enabled unless you request a testing account as described in the link. Confirmed the same results when using the non-enabled account in the Outlook Oauth Sandbox.
From the first link
Because enabling mailboxes on Outlook.com for the Outlook REST API happens over a period of time, your existing Outlook.com account may take a while to get enabled. To test your app accessing data on Outlook.com mailboxes that have already been enabled, you can request a new, enabled Outlook.com developer preview account by emailing outlookdev#microsoft.com.
If your app accesses Outlook.com mailbox data, it should handle scenarios where the user's mailbox has not yet been enabled for the Outlook REST API. In such situations, when you make a REST request, you would get an error like the following:
HTTP error: 404
Error code: MailboxNotEnabledForRESTAPI or MailboxNotSupportedForRESTAPI
Error message: “REST API is not yet supported for this mailbox.
Step 1 :
Click the Below Link :
https://oauthplay.azurewebsites.net/?code=M657b8bab-e543-f849-134c-0a2f85179a67&state=17661047-2a14-4c90-9edd-0119f841b559
Step 2:
Step 3 :
Step 4 :
Step 5 :

Resources