EWS Java SendInvitationsMode SendToNone - exchange-server

i dont understand a sence of SendInvitationsMode.SendToNone.
Msdn.microsoft.com shows, how appointment could be created with this
option:
https://msdn.microsoft.com/en-us/library/office/dd633661(v=exchg.80).aspx
But when i am not using this option and set only start- and end-date to the same date (for example 2016-12-12) and save like this:
appointment.save();
, i expect, that outlook shows me in my calender this appointment only on the date: 2016-12-12.
But outlook shows me some different days. Obviously start- and end-date will be ignored, when i'am not set this option, when i save appointment: SendInvitationsMode.SendToNone.
"SendToNone" means for me, that this appointment will not be send to something else.

SendToNone means if you have a Meeting that when you create the meeting appointment meeting invitations will not be sent when you call save.
But when i am not using this option and set only start- and end-date to the same date (for example 2016-12-12) and save like this:
What are you trying to achieve though? are you trying to create an All Day appointment ? https://msdn.microsoft.com/en-us/library/office/dn756538(v=exchg.150).aspx the thing to be careful of here is matching the timezone if you have users in different timezone.

Related

Google Classroom (PHP Client Services): Create CourseWork with Due Date but No set Due Time

I've been working on creating Google Classroom Classwork programmatically using the Google PHP api client services library. I am able to successfully create coursework, using: courses_courseWork->create, and passing a coursework object.
However, I can't seem to create a Course work object with a due date but no due time. Creating without a due date works fine, but if I just set a due date, it says that a due time object ( Google_Service_Classroom_TimeOfDay ) must also be sent. I've tried creating without setting hours / minutes / seconds / nanos, I've tried setting them to null, and I've tried unsetting the object properties after creating it.
When I look at a created ClassWork object (through the web interface, with no due date), the dueTime object property is just an empty array. I cannot for the life of me figure out how to pass that when creating with the API.
Thank you!
Your question is a little old, but in case someone else is having this issue, if you set a dueDate, you must also set a dueTime. This is a requirement from the API:
dueDate: object(Date):
Optional date, in UTC, that submissions for this course work are due.
This must be specified if dueTime is specified.
dueTime: object(TimeOfDay):
Optional time of day, in UTC, that submissions for this course work are due.
This must be specified if dueDate is specified.
See: https://developers.google.com/classroom/reference/rest/v1/courses.courseWork#CourseWorkState
Also, as noted, all create request dates and times should be converted to UTC. Depending on how your app is set up, this can quickly get a bit complicated...
It may be easiest to use a library like moment.js or luxon, etc. to manipulate the dates.
(I used moment.js, converted the moment datetime object to UTC, then converted the moment object .toArray, which I iterated through to create dueDate and dueTime objects for the request)

Cant get facebook date range working for events in ruby/koala

I am using ruby koala facebook graph API gem to retrieve events but cant restrict the events using a date range. I seem to be getting all events (even ones which have happened). What I am trying to do is get events is the next 200 days. I am using the following (ruby) code:
Koala.config.api_version = 'v2.10'
oauth = Koala::Facebook::OAuth.new app_id, app_secret
graph = Koala::Facebook::API.new oauth.get_app_access_token
from_date = Date.today
to_date = from_date + 200
fb_events = graph.get_object( fb_venue["url_listings"] + "?time_range={\"since\":#{from_date}, \"until\":#{to_date}" )
I am then getting the events 25 at once (the facebook default limit) using 'fb_events.next_page' to get them all.
I seem to get getting all events, including ones is the past.
Are you sure that the #get_object method wants a query string like that? Based on the docs[1], it seems that you should pass your object ID (which I assume is in fb_venue['url_listings'] for you as a first arg, and then metadata in a subsequent arg as a Hash. So I'd try something like:
fb_events = graph.get_object(fb_venue['url_listings'],
{since: from_date, until: to_date})
...according to the key/nesting structure FB expects.
Edit: forgot link to docs.
[1] -
http://www.rubydoc.info/github/arsduo/koala/Koala%2FFacebook%2FGraphAPIMethods%3Aget_object
According to the doc I don't think that you can request all the events, You can only select an event by using /{event-id} like this example or you can get user's events but you will need to ask him for the permission according to
permissions.
add user_events to the list of scope that you are permitting from user.
By this when user sign up using Facebook to your application it will take a permission for his events.
After that by using graph.get_object({facebook-user-id} + '/events') you will get 25 of his events as a default value and you can add {limit: 5} as a second parameter to the get_object function, You can use until and since but they should be in A Unix timestamp look at this to see the needed date format, hope this would help.

Exchange Managed API: Get Resources List of an appointment

I am creating a utility to get sync room calendar with my application.
They way i do is by calling syncfolderitems function for the room I want to sync.
Issue:
Since a User creates an Appointment and we are syncing room calendar thus we are not able to fetch value for Resources property. After doing some research I found that there is an extended property that can be used to find all attendees (Rooms are also attendees) of appointment.
Extended property was "PidLidAllAttendeesString".
Issue with this property is that it returns all the attendees of an appointment (Sendable and Unsendable both).
Is there any property that contains only Sendable attendees data ?
Based on [MS-OXPROPS], PidLidToAttendeesString "Contains a list of all of the sendable attendees who are also required attendees." Downloading the PDF of [MS-OXPROPS] and searching on "sendable" or "resource" might yield some other options too. Hope that helps!

How to use the Google API Explorer with startTime for google calendar

I am trying to use this api explorer here
https://developers.google.com/google-apps/calendar/v3/reference/events/list#try-it
All other p[arameters works but i am not able to use
timeMin and timeMax
It gives error but not specific anyone.
Can anyone give me example of anything to put in timeMin which works
If i use like this
Then it works but if i add the timeMax like this , then i get error
That's not a time, that's a date. You need an ISO format datetime, eg "2013-08-10T00:00:00Z" (the Z is the timezone, in this case UTC).

Facebook FQL returns <fql_query_response list="true"/>

I am trying to get a facebook fql query to work using the browser, I have a valid oauth token (I can make graph api calls with it).
Here is the url I tried:
https://api.facebook.com/method/fql.query?query=SELECT metric, value FROM insights WHERE object_id=89192912655 AND end_time=1280430050 AND period=86400 AND metric='page_fans'&access_token=?
I also tried running the fql query through a sql encoder first:
https://api.facebook.com/method/fql.query?query=SELECT%20metric%2C%20value%20FROM%20insights%20WHERE%20object_id%3D89192912655%20AND%20end_time%3D1280430050%20AND%20period%3D86400%20AND%20metric%3D'page_fans'&access_token=?
I tried a few other metrics, I can get the metrics via the graph api as well, so I know they are there.
Im sure im doing something dumb, but I have been stumped on this for a while now! Every call just returns this:
<?xml version="1.0" encoding="UTF-8"?>
<fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true"/>
Maybe my dates are a problem, I used this to get the date: (ruby)
t = Time.now
=> Tue Aug 03 15:00:50 -0400 2010
>> t = t - 5.days
=> Thu Jul 29 15:00:50 -0400 2010
>> t.to_i
=> 1280430050
any ideas?
We have confirmed this bug. This is due to the end_time having to be aligned with day delimiters in PST in order for the Insights table to return any data. To address this issue, we introduced two custom functions you can use to query the insights table:
end_time_date() : accept DATE in string form(e.g. '2010-08-01')
period() : accept 'lifetime', 'day', 'week' and 'month'
For example, you can now query the insights table using:
SELECT metric, value FROM insights
WHERE object_id = YOUR_APP_ID AND
metric = 'application_active_users' AND
end_time = end_time_date('2010-09-01') AND
period = period('day');
We will document about these functions soon, sorry for all the inconvenience!
P.S. If you don't want to use the end_time_date() function, please make sure the end_time timestamp in your query is aligned with day delimiters in PST.
Thanks!
Facebook Insights Team
The response you're seeing is an empty response which doesn't necessarily mean there's no metric data available. A few ideas what might cause this:
Are you using a user access token? If yes, does the user own the page? Is the 'read_insights' extended permission granted for the user / access token? How about 'offline_access'?
end_time needs should be specified as midnight, Pacific Time.
Valid periods are 86400, 604800, 2592000 (day, week, month)
Does querying 'page_fan_adds' metric yield meaningful results for a given period?
While I haven't worked with the insights table, working with Facebook's FQL taught me not to expect error messages, error codes but try to follow the documentation (if available) and then experiment with it...
As for the date, use the following ruby snippet for midnight, today:
Date.new(2010,9,14).to_time.to_i
I also found the following on the Graph API documentation page:
Impersonation
You can impersonate pages administrated by your users by requesting the "manage_pages" extended permission.
Once a user has granted your application the "manage_pages" permission, the "accounts" connection will yield an additional access_token property for every page administrated by the current user. These access_tokens can be used to make calls on behalf of a page. The permissions granted by a user to your application will now also be applicable to their pages. (source)
Have you tried requesting this permission and use &metadata=1 in a Graph API query to get the access token for each account?
If you want to know the number of fans a facebook page has, use something like:
https://graph.facebook.com/cocacola
The response contains a fan_count property.
I'm not sure the date is correct. do you really want the date as an integer?
Usually SQL takes dates in db-format, so to format it you'd use:
Date.new(2010,9,14).to_s(:db)
(Time.now - 5.days).to_s(:db)
# or even better:
5.days.ago.to_s(:db)
If, like me, you came here after getting this from another FQL statement, then your problem is not including the access_token parameter, e.g.
https://api.facebook.com/method/fql.query?query=SELECT+name+FROM+user+WHERE+uid+%3D+me()&access_token=...
(You can use fb.getAccessToken())

Resources