I am trying to get the groups and group members in the office 365 by API.
I am able to get the group and group member list by using below API
https://graph.microsoft.com/v1.0/groups
https://graph.microsoft.com/v1.0/groups/e875D371-db4c-4371-b315-5970fXXXff76/members
Here my problem is I need to get the next page of the graph explorer. How could I get the next page of result?
I tried the &$skiptoken but it did not work or maybe I have not used correctly!
Can anyone kindly guide me to get the next page of the result?
Use below example code
https://graph.microsoft.com/beta/groups/9ckkqecb-43c6-4295-ac69-02bcaeac6570/members?$top=999&$select=id,displayName
this will give the first 999 result.
$skiptoken is described in the official docs here. To summarize, results that are paged will have a "#odata.nextLink" in the response. This value is the resource you will use to get the rest of the results. You can chain links together over and over, if necessary, until the entire result set is returned.
Related
I am trying to get all organization items through http://host/api/v3/organizations?page=2&per_page=100
The default size seems like 30, and 100 seems like the max limit per request.
But above link still only returns the first 100 items, i.e, not 101-200th
I also tried http:host//api/v3/organizations?page=2
No matter which page I set, it only returns the first 30 items.
How can I get the entire list of organization items please? Please help. Appreciate.
From Github API reference for listing organizations :
Note: Pagination is powered exclusively by the since parameter. Use
the Link header to get the URL for the next page of organizations.
For instance checking the 2nd page using curl :
curl -I "https://api.github.com/organizations"
gives the following link header :
Link: <https://api.github.com/organizations?since=3043>; rel="next", <https://api.github.com/organizations{?since}>; rel="first"
So the next page will be https://api.github.com/organizations?since=3043
For each request you would check this header to get the next url to hit
I saw this question (Query multiple insights metrics in one API call) but their answers are from 2012 and no longer work.
I want to get post_video_avg_time_watched and post_video_views in a single api call to Facebook.
How is this possible?
I don't want to use Facebook's batch request, because it counts against my rate limits twice instead of once.
Yes, and easily! Just add the second value after a comma and the first value like so: /insights/post_video_views,post_video_avg_time_watched/lifetime
I am trying to get post insights for a page feed using Facebook Graph API version 2.7 ..
If I only write:
'[Page ID]/feed?fields=insights'
It asks for metric, which indicates it should work... But when specifying a metric:
'[Page ID]/feed?fields=insights/post_impressions/lifetime'
I get syntax error.
I've tried with . notation as:
'[Page ID]/feed.insights/post_impressions/lifetime'
But stil no luck!
I know I can do it post by post (separate calls to API), but that is what I'm trying to avoid.
Anyone know what the correct syntax is for nested insights?
This bug report was able to shed some light: https://developers.facebook.com/bugs/1755454881375647/
You can use the metric keyword to specify the metrics you want, like so:
/page-id/posts?fields=insights.metric(post_impressions,post_consumptions_unique)
Name the metrics you are interested in there, and separate them with a comma.
Specifying the period (where applicable) seems to work by the same kind of syntax,
/…?fields=insights.metric(…).period(lifetime)
(Although it might not work to request different periods for different metrics in one go.)
I'm after the impression uniques for our posts and ideally we would like one server call and it would bring back the last 100 posts with the reach (post_impressions_unique).
To get reach, I can currently do this using:
https://graph.facebook.com/nmemagazine/posts?fields=name,message,full_picture,created_time,shares,likes.limit(1).summary(true),comments.limit(1).summary(true)&access_token=USER_TOKEN
and getting the post ID, then calling: https://graph.facebook.com/v2.5/POST_ID/insights/post_impressions_unique?access_token=USER_TOKEN
Is there a way where I can make one call to get all recent posts and their reach in one API call?
You could simply call
https://graph.facebook.com/nmemagazine/posts?fields=name,message,full_picture,created_time,shares,likes.limit(1).summary(true),comments.limit(1).summary(true),insights&access_token=USER_TOKEN
NOTE: extra field "insights".
However, as far as I can tell you cannot limit the insights to just Post_impressions_Unique so it would bring back some data you do not necessarily want/need. I.e. I don't think you can perform a search/filter on a "second level"/child/nested type.
To give an update on this:
In facebook Graph API 2.10, you can (and have to) specify the metrics you are interested in via insights.metric(...). Possible metrics are documented here:
https://developers.facebook.com/docs/graph-api/reference/v2.10/insights#availmetrics
For your example:
curl -i -X GET "https://graph.facebook.com/nmemagazine/posts?fields=name,message,full_picture,created_time,shares,likes.limit(1).summary(true),comments.limit(1).summary(true),insights.metric(post_impressions_unique)&access_token=USER_TOKEN"
Facebook OpenGrap API limit results of [id]/checkins to 500. Is there are way to retrieve more than 500. Example if I want to retirve all the place someone has checkin for year 2011. What are possible available methods. Is there a premium service provided by Facebook.
Regards,
Waruna.
As the open grpah documentation describes, there should be a "paging" object at the end of the api response if there is more content than you could load at one time. You can test this by clicking the example links inthe documentation. So, the solution is: Loop your requests until there is no "next" property in the "paging" object of the response.
Also there are possibilites to batch your requests, maybe this is also useful for you.