I am using the Outlook REST API for creating events and sending its invitations, based on this documentation
I authenticate the logged in user, and send its Bearer token through the Authorization header of the request, and the json-formatted event on its content.
If I set the "Organizer" to another user rather than the authenticated one, as well as the "IsOrganizer" property to "false", it gets totally ignored and sets the current logged in user as the organizer.
Any clues of what could be happening?
Is there another way of doing this?
Thank you!
I'm posting this in case someone else finds and needs an answer for this scenario...
You (Account A) can create a calendar event as someone else (Account B) through Office365 REST APIs as long as the account has permission to send as the other user account.
Here are the steps:
1) Call the Office365 REST API as follows,where {{{user2email}}} is the user you want the event to be created as (Account B's email address):
https://outlook.office365.com/api/v1.0/users/{{{user2email}}}/calendar
This should return Account B's user's calendar ID.
2) Pass in your JSON - the following is an example of what I used during unit testing:
{
"Subject": "Test - Created using Office365 Calendar REST API should be from Technology Notice",
"IsOrganizer": "False",
"Body": {
"ContentType": "HTML",
"Content": "This is where body copy goes HTML supported"
},
"Start": "2015-12-11T19:00:00Z",
"End": "2015-12-11T20:00:00Z",
"Attendees": [
{
"EmailAddress": {
"Address": "attendee1#yourcompany.com",
"Name": "Attendee One"
},
"Type": "Required"
}
],
"Organizer": {
"EmailAddress": {
"Address": "tnotice#yourcompany.com",
"Name": "Technology Notice"
}
}
}
'Technology Notice' will be who the calendar invite is from.
3) Use the ID from step 2 in your POST request, for example:
https://outlook.office365.com/api/v1.0/users/{{{user2email}}}/calendars/{{{ID}}}/events
Note: Make sure you're sending the POST request as the authenticated user account (Account A) who's account the mailbox/calendar it actually belongs to.
If everything is right you should be able to send a calendar invite and have it show up as originating from Account B instead of Account A.
Hope this helps someone out.
This is the correct behavior. You cannot create an event on User A's calendar but set the organizer to User B.
Related
Trying to create a Skype Bot, but I have a problem. Please, help me.
I use PHP so I use REST (not NodeJS or C# SDK).
The task: I have to send data from html form on my website to Skype (so I don’t have to reply to a message, but just send).
Well, I have successfully create a bot in Microsoft Bot Framework.
Then I have successfully received an access_token.
Then they say in docs that I have to send a POST to:
/v3/conversations/{conversationId}/activities
According to https://learn.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-connector-send-and-receive-messages I have to send a request to /v3/conversations with JSON like that:
{
"bot": {
"id": "12345678",
"name": "bot's name"
},
"isGroup": false,
"members": [
{
"id": "1234abcd",
"name": "recipient's name"
}
],
"topicName": "News Alert"
}
But what is the "member's id and member's name"?
To get the member ids of some members, add all those members in a group and add the bot, too, to the group and preferably send a message in the group, mentioning the bot. You will receive a json with a conversationId. With this conversationId, make a get request to v3/conversations/{conversationId}/members in order to receive the member-ids and member-names of the members in the group.
You can now proceed with these member-ids and member-names to start individual conversations with the members (which is illustrated in my answer to this question).
I've got the Webhooks working for our developer accounts, and it emits a status_changed message every time there is an Uber request, even if the request was not initiated from our app (using the "all_trips" permission)
When we get the response back, how do we determine which user this is for? E.g. in the response below, there is no way to determine that and using the server token to authenticate to the resource_href gives an "Invalid OAuth 2.0 credentials provided" error.
{
"event_id": "3a3f3da4-14ac-4056-bbf2-d0b9cdcb0777",
"event_time": 1427343990,
"event_type": "all_trips.status_changed",
"meta": {
"resource_id": "2a2f3da4",
"resource_type": "request",
"status": "accepted"
},
"resource_href": "https://api.uber.com/v1/requests/2a2f3da4"
}
Thanks for catching this! We rolled out a fix that adds the users UUID as an additional field in the "meta" section, as well as updated our documentation here: https://developer.uber.com/docs/webhooks
Let us know if you have any more trouble!
I'm working on an iOS app and noticed that one user is not loaded when I do a requestForMyFriends.
After looking more into this it seems that the Graph API explorer also doesn't return anything for the particular Facebook user. It's a user and not a Fanpage or something.
So:
I've the page for example (which when I enter In my browser will bring up the Page nicely): https://www.facebook.com/user-name
https://graph.facebook.com/https://www.facebook.com/user-name
Will return:
{
id: "https://www.facebook.com/user-name"
}
https://graph.facebook.com/user-name
Will return:
{
error: {
message: "Unsupported get request.",
type: "GraphMethodException",
code: 100
}
}
http://findmyfacebookid.com/ wil return nothing.
The graph API will return:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
I'm trying to reproduce this with my test Facebook account and put all restrictions to the max but I always get a nice result with a FacebookId.
My question:
What settings do I need to change to my test Facebook account to reproduce this problem?
"Unsupported GET Request" covers many situations, but at the root the message means you tried to request something via the API which is not available to you via the API
For a request which attempts to retrieve data about a known username or user ID the most likely reasons are:
User has blocked your app
User has disabled all platform apps in their privacy settings
User has deactivated their account
User has deleted their account
if i had to bet, I'd say it's the second one in this case
The problem is the parameter, you don't have to pass in the whole URL of a profile, just the username/profile-id.
For example: we want to get the info of Mark Zuckerberg. His Facebook username is zuck. The URL would be https://graph.facebook.com/zuck and will return the following output
{
"id": "4",
"name": "Mark Zuckerberg",
"first_name": "Mark",
"last_name": "Zuckerberg",
"link": "http://www.facebook.com/zuck",
"username": "zuck",
"gender": "male",
"locale": "en_US"
}
Using https://graph.facebook.com/4 (4 is the profile id of Mark Zuckerberg) would produce the same output.
Edit
After some further investigation it turned out that said user might have deactivated her account and that is why you see this error. I have used a testuser of one of my apps, went to Settings -> Security -> Deactivate my account and taxa, every request to the Graph API returned the result you're seeing.
Just am trying to use BOX API for collaboration. i just wanted to know is there any REST api call available to invite a external user.
You just POST to https://api.box.com/2.0/collaborations with the proper auth header for your user that is authenticated (the person doing the invitation to collaborate). In the body of the request you would put the JSON to specify the folder and the invitee.
{"item": { "id": "12137", "type": "folder"}, "accessible_by": { "login": "rob#winterfell.com"}, "role": "editor"}
Then rob#winterfell.com will get an email telling them that they've been invited to see the appropriate folder.
When using the requests dialog, facebook issues a notification like this:
What I'm looking to achieve is for the user to click the request link shown above and to present a "Random User invited you to..." message on our App.
However, when clicking that link Facebook doesn't seem to pass through the id of "Random User" to the App. The url accessed by the link looks something like:
http://apps.facebook.com/randomcomp/?fb_source=notification&request_ids=350578327437399,350578327437399&ref=notif&app_request_type=user_to_user¬if_t=app_request
which doesn't contain any reference to the user who initiated the request.
From the App's side, there doesn't seem to be a way to get this information from Facebook. Sure, you can get a list of requests, but that list can contain information for many requests, including requests from other users in addition to the one we're interested in, so it's not useful in this case. For example, here's a snapshot of data:
{
"data": [
{
"id": "340083146057323_100003817986566",
"application": {
"name": "Random Competition",
"namespace": "randomcomp",
"id": "350578327437399"
},
"to": {
"name": "Hannah Smith",
"id": "100003817986566"
},
"from": {
"name": "Random User",
"id": "100002286042525"
},
"data": "100002286042525",
"message": "Use the app!",
"created_time": "2012-05-14T13:26:30+0000"
}, {
"id": "358318457550141_100003817986566",
"application": {
"name": "Random Competition",
"namespace": "randomcomp",
"id": "350578327437399"
},
"to": {
"name": "Hannah Smith",
"id": "100003817986566"
},
"from": {
"name": "Jane Young",
"id": "100003771838663"
},
"data": "100002286042525",
"message": "Use the app!",
"created_time": "2012-05-14T10:54:25+0000"
}],
}
}
As you can see, the data is being passed in, but there's still no way to join the click from the link mentioned above (for Random User) to the correct request in the list; the link passes through the ID for both requests, not just the one for Random User, and while the link states "Random User" it doesn't pass through an identifier.
Am I missing something? Is there a mechanism that isn't in the docs that will allow me to pick-up the "Random User" id so I can provide a nice "Random User invited you to..." message in the App when they click through?
Edit:
Turns out that this isn't possible - see my answer.
You can add some data to the request so that when you process the request you can differentiate that from other requests.
The data can be sent with app requests and users requests and the parameter name is "data".
For example, in the guide for the Requests Dialog you can see it in the properties table at the (almost) end of the document, it says:
Optional, additional data you may pass for tracking. This will be
stored as part of the request objects created. The maximum length is
255 characters
There's also some info about it in the Social Channels documentation, and a sample of (php) usage in the official blog post about Upgrade to Requests 2.0.
I hope that this is what you're looking for.
Edit
When you send the request you know who is sending it right? It's the logged in user, and so you can put the user id/name/etc in the data parameter of the request.
Then, when someone clicks on a request, get the request by the id that facebook passes to you, and from the data extract the user id of the sender.
As the documentation states, you have 255 characters to use, and with that you can do what ever you want, you can even serialize an object to that parameter and deserialize it later.
As it turns out, this is in fact not possible at all.
The link, as shown in the image below, can present multiple users:
which is why multiple request IDs are passed in, and the sender's ID isn't.