How to do pagination based on page numbers using Microsoft Graph API - azure-active-directory

In MS documentation about paging there is a certain way for paginating the resources. Instead of using skiptoken to reach next page of resources, want to paginate user resources based on page numbers. So that i don't have to use skip token 5 times to reach 6th page of resources and reach it directly.
How can i do this using MS Graph API. Is it possible?

Pagination based on the page number is not supported on user resource.
Some resources support $skip query parameter which allows to set the number of items to skip at the start of a collection but $skip parameter is not supported by the endpoint https://graph.microsoft.com/v1.0/users

Related

How to retrieve site url's efficiently for all users in a tenant using Microsoft Graph API

Here is the problem:
I have a tenant with 50,000 users Every day I need to pull that user list to see what has changed. Example: Which users were added or removed, and what are their mySite URL is.
I can get some general information calling /users but, I need each user's mySite. The only way I have found to retrieve that is to call /users/userId?$select=mySite.
This implies I must make 50k calls and I then encounter throttling issues.
Is there a way through Microsoft Graph (or some other mechanism) to pull the user data, including mySite efficiently?

Data in database and google analytics does not match

Why are the counts I see in my database different than what I see in Google Analytics? The goal conversion number showing in Google Analytics is much lower than what I see in the database. This is the case for several months.
Few reasons here
Sampled data vs. unsampled data: You can read about here: https://support.google.com/analytics/answer/1042498?hl=en - For API work i normally use a web query explorer to verify that my API call's are being sent and responses match to verify the data: https://ga-dev-tools.appspot.com/explorer/
Adblockers: You might get hits/submissions from people where they are using an ad blocker, hence more entries in Database or Google Analytics.
Users vs. Sessions vs. Hits: You are looking at Unique Visitors/Sessions in Google Analytics instead of the total number of "Events", Not sure how your Goal is setup but best to use events and look at "Total Events" and "Unique Events" to get a sense.
Implementation: You may be firing JavaScript after the person has hit the button without waiting for the page change, can happen on some sites where you take them to a thank-you page or something. Best to check how this is setup and the order in which tag fires and page works.

Profile Photo for mutliple users from Azure AD

I am executing a search operation for people search using Microsoft Graph Endpoint - https://graph.microsoft.com/V1.0/users.
The question I have is - I am able to get all the textual data I need, but is there a way to get photo for each returned user in a single call?. If there are 10 users returned in the previous search, executing 10 different operations to get the photos based on each user's id would be a challenge.
It isn't possible to fetch both user's data and photo in a single call since they are different data types (application/json vs image/jpeg).
Marc is spot on here. However you should also check out the new batching feature (note this is still in /beta) which would allow you to get up to 5 photos in one request round-trip. See https://developer.microsoft.com/en-us/graph/docs/concepts/json_batching. We'd love to get your feedback on this.

GAE datastore -- proper ways to implement search/data retrieval in response to a user request?

I am writing a web app and I am trying to improve the performance of search/displaying results. I am relatively new to programming this sort of thing, so I apologize in advance if these are simple questions/concepts.
Right now I have a database of ~20,000 sites, each with properties, and I have a search form that (for now) just asks the database to pull all sites within a set distance (for this example, say 50km). I have put the data into an index and use the Search API to find sites.
I am noticing that the database search takes ~2-3 seconds to:
1) Search the index
2) Get a list of key names (this is stored in the search index)
3) Using key names, pull from datastore (in a loop) and extract data properties to be displayed to the user
4) Transmit data to the user via jinja template variables
This is also only getting 20 results (the default maximum for a Search API query.. I haven't implemented cursors here yet, although I will have to).
For whatever reason, it feels quite slow.. I am wondering what websites do to make the process seem faster. Do they implement some kind of "asynchronous" search, where a page loads while in the background the search/data pulls are processed, and then subsequently shown to the user...?
Are there "standard" ways of performing searches here where the processing/loading feels seamless to the user?
Thanks.
edit
Would doing something like just passing a "query ID" via the page work, and then using AJAX to get data from the datastore via JSON work? Like... can app engine redirect the user to the final page, pass in only a "query ID", and then search in the meantime, and then once the data is ready, pass the information the user via JSON?
Make sure you are getting entities from the datastore in parallel. Since you already have the key names, you just have to pass your list of keys to the appropriate method.
For db:
MyModel.get_by_key_name(key_names)
For ndb:
ndb.get_multi([ndb.Key.from_path('MyModel', key_name) for key_name in key_names])
If you needed to do datastore queries, you could enable parallel fetches with the query.run (db) and query.fetch_async (ndb) methods.

Amazon MWS API - How do i get detailpageurl, product reviews, totalresult count

I have integrated the Amazon MWS api.For searching matching products from amazon i have used ListMatchingProducts as operation. I got the response as XML but in XML Some of the information isn't provided by the Amazon MWS API is there any other way to get it? The following information is not able to get from api response xml.
How do we get more pages of results beyond the first page? Right now we only get the first.
We cannot find big images for products, only getting small images
We cannot find the detailpageurl for products.
Where do we get the description? The only thing we are able to pull right now is the product "Features" but no description.
How do you search by Amazon nodes? All we see is search by keywords, but we use nodes all the time in the old Amazon PA-API.
For larger images, you can substitute out the numbers following "_SL" in the image name for the desired width. ie: SL160.jpg becomes SL400.jpg for a 400px width image.
A quick version of the detail page URL can be constructed by appending the ASIN to http://www.amazon.com/dp/
I don't think the other functionality that you desired is available through the MWS Products API.

Resources