Sorry if this question sounds a bit broad but the question describes what I am trying to do.
In my organisation I am trying to get events from certain people's calendar and then add those events into one shared calendar, Like creating a team shared calendar displaying what everyone's time availability.
Though as a starting point, I want to be able to retrieve the events from their calendars and displaying them on a table. Can anyone point me to a tutorial on how to do that in an asp.net app ?
We don't currently have a sample that handles this scenario specifically, but we do have a number of ASP.NET samples that could help you get started with Microsoft Graph + ASP.NET: https://github.com/microsoftgraph?utf8=%E2%9C%93&q=asp
This page shows you how to get events for a specific user by using raw REST calls to the Microsoft Graph endpoint: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list_events
Were you planning on using the Microsoft Graph .NET SDK instead of raw REST calls? I can provide a code snippet for that if you're interested.
You need to make sure that you, or an Azure Admin, “Grant Permission” to the various requested Graph permissions. Some of them require explicit Admin consent. From there you can use the Users[{username}].Events.Request().GetAsync() to retrieve events. Be sure to supply the required start & end datetime parameters.
Related
Given a facebook username and password, how do I grab the latest status updates from his feed? Moreover, i'd like to know how to get last updates from user profile.
I'm having trouble finding an answer to this question, and I'd like to know whether it could by done using PHP or C# (C# is prefrred). I'd be grateful if anyone could point me to the solution, thanks in advance !
You can easily do that by using the Facebook Graph API in any language. I suggest you should look at the API documentation, specifically the User Reference Doc (you can retrieve any user's status updates using this). It might take some time to understand how it all work, but you can retrieve user information very easily, provided you have the knowledge of a specific language and you understand how the Graph API actually works (there are plenty of example on the developers' website).
Also, you don't even require user's password for this. All you need is the user's id or username and some permissions from that user (or simply an Access Token).
PS: If you have any specific problem in your code, please update your question with some code that you've written till now and I'll be happy to help you with that.
I've been using a class based on Hernan Amiune's library for the Facebook graph API to allow website user's to write to their friends walls from my code. With the recent February changes the Graph API method to do this is no longer available.
Apparently I need to use the Feed Dialogue now, but can I call this from c# code? Does anyone have a sample or an alternative I can use?
In short can I write to someone's wall on behalf of another user using server side code only.
In short can I write to someone's wall on behalf of another user using server side code only?
As of the February 6 breaking changes, you can no longer post to a user's friends' wall via the Graph API. This means you can't write on someone's wall on behalf of another user in any code language or SDK. You either have to use the Feed Dialog or use Mention Tagging or Action Tagging.
From the Facebook Developer Roadmap:
Stories that include friends via user mentions tagging or action tagging will show up on the friend’s timeline (assuming the friend approves the tag).
Have you looked at Feed Dialogue info which details a nice simple javascript example and even simpler a direct url example, to convert either to utilise C# seems an extremely trivial task.
See A related answer
I am using Google API Version 2 fo .NET to create Google Calendar Entries.
How can i add "Attachment" to Google Calendar?
Thanx
I was trying to find the answer to this question myself, and after looking through the XML results for various queries using the Calendar API feeds, I'm pretty sure there isn't currently a way to retrieve or update file attachments. Since calendar event file attachments is a lab feature from Google, it's not entirely surprising that they aren't yet available through the public API.
Depending on what you are trying to do, you could use extended properties to store additional information about attachments in an event, but these values won't be read by the calendar web client, so you would only be able to use them for your own application.
A couple other things (admittedly hacks) you could try:
The ICAL feed provided by Google
Calendar provides an ATTACH:
property. You could have your app use
the import url to import an ics file
containing your attachment.
You could
simulate the web client, which posts
a gdoc-attachment parameter to update
an events with an attachment.
You also might try posting to the calendar help forums. The only related post I could find was here.
Good luck!
For all the future generations reading this, the attachments are now supported, here is the guide on how to do it: https://developers.google.com/google-apps/calendar/create-events#attachments
I've got a site which produces charts such as the one below
I'd like to encourage visitors to embed the generated graphic on their own sites and blogs. Is it possible to include views for that chart in google Analytics? I want to be able to see when a site embeds the image so that it's tracked in the analytics reports.
I'd envision some API that I can call from the server-side method which generates the PNG, but haven't been able to find anything specific.
Thanks!
This is indeed possible, have a look at the Google Analytics for Mobile Websites documentation. This details how to build a request to google analytics on the server, with quite a few different code samples (C# included).
While this documentation revolves around tracking page views, this concept could be extended to other types of activity you can record in google analytics, such as Events. In your specific situation I think I would want to setup the view of the chart as an Event, as this will not 'mess up' your true traffic (though you could use an advanced segment to exclude the chart traffic if you chose to register them as page views).
The documentation for event tracking is available here. Looking through it should give you a good idea of how you could express viewing your charts. Once you got an idea of how you wanted to track the event in GA, write the javascript and then view the URL (beacon) it generates to send the information to google. You'll be able to use that as a template to send event information from the server.
In regards to actually serving the image, you have a lot of options. If you app is written in MVC, look at the FileResult class (and the asssociated File() method available on the Controller class). If you working in a Webforms app, you will be using a Response.WriteFile() or something to that affect. This wrox article has an example of the idea behind this. The example is for creating a no leaching / hotlinking image handler, but the concept of writing an image to the HttpReponse is the same.
I am using Google API Version 2 fo .NET to create Google Calendar Entries.
How can i add "Attachment" to Google Calendar?
Thanx
I was trying to find the answer to this question myself, and after looking through the XML results for various queries using the Calendar API feeds, I'm pretty sure there isn't currently a way to retrieve or update file attachments. Since calendar event file attachments is a lab feature from Google, it's not entirely surprising that they aren't yet available through the public API.
Depending on what you are trying to do, you could use extended properties to store additional information about attachments in an event, but these values won't be read by the calendar web client, so you would only be able to use them for your own application.
A couple other things (admittedly hacks) you could try:
The ICAL feed provided by Google
Calendar provides an ATTACH:
property. You could have your app use
the import url to import an ics file
containing your attachment.
You could
simulate the web client, which posts
a gdoc-attachment parameter to update
an events with an attachment.
You also might try posting to the calendar help forums. The only related post I could find was here.
Good luck!
For all the future generations reading this, the attachments are now supported, here is the guide on how to do it: https://developers.google.com/google-apps/calendar/create-events#attachments