keycloak - does keycloak have any endpoint to get list of user paginated - keycloak

I am trying to get list of user paginated
I tried work with this endpoint
GET /admin/realms/{realm}/users
but the response contain all the user.

Endpoint GET /admin/realms/{realm}/users supports pagination (look at method source code)
Just add query params first & max to your request. For example:
/auth/admin/realms/<your realm>/users?briefRepresentation=true&first=0&max=5
P.S. Total records count will be returned in response headers

Related

Get all elements from sharepoint list query via ms graph api

I use a GET request with the following url to retrieve data from a sharepoint list:
https://graph.microsoft.com/v1.0/sites/{site_id}/lists/{list_id}/items?expand=fields
However, in the value-key of the response dict i get only 200 entries. The List has roughly 250 entries.
So I guess microsoft graph api has some limitation on how many samples can be requested from the endpoint at once.
I cannot find anything in the doc (https://learn.microsoft.com/en-us/graph/api/listitem-list?view=graph-rest-1.0&tabs=http) on how I could get the missing entries.
Any clues?
If the request does not contain all elements the json response contains a key #odata.nextLink.
a get request on that link gives you the next 200 entries in the list

Aggregate functions in WIQL query

I want download WIQL report using REST API. REST response doesn't give all fields but it gives a list of URLS as workItems.
To get field values I need to download each WorkItem separately.
Any direct REST way to accomplish this in a single REST call?
Repeated REST calls gives me rate limiting or similar error. I get error 500 types after repeated GET request.
Genesis of this need is - There are no aggerate functions available likes of SUM, MAX, MIN, AVG Etc.
REST response doesn't give all fields but it gives a list of URLS as
workItems.
To get field values I need to download each WorkItem separately. Any
direct REST way to accomplish this in a single REST call?
Sorry but as I know, there's no direct rest api available to get WIQL report. An alternative workaround should be:
1.Use Query By Wiql to return the list of WorkItem IDs and Urls (I think this is the same rest api you use).
2.Then use Get Work Items Batch to get all the details(fields) about the requested work item ids. And here's one issue which has similar needs like yours, you can use the upgraded script from konpro11 to get list of IDs and use the IDs to get your report (with the help of second rest api).
Hope it helps :)

Retrieve all of a user's playlist from SoundCloud limited to 50?

I'm trying to retrieve all the playlists from my account via
http://api.soundcloud.com/users/145295911/playlists?client_id=xxxxxx, as the API reference shows.
However, I can only retrieve recent 50 playlists instead of all of my playlists. I've been looking for this but it seems like no one has had this issue before. Is there a way to get all of them?
Check out the section of their API on pagination.
Most results from our API are returned as a collection. The number of items in the collection returned is limited to 50 by default with a maximum value of 200. Most endpoints support a linked_partitioning parameter that will allow you to page through collections. When this parameter is passed, the response will contain a next_href property if there are additional results. To fetch the next page of results, simply follow that URI. If the response does not contain a next_href property, you have reached the end of the results.

Get Facebook page like count for OpenGraph v2.10

I can't get Facebook to return the page like count, the response provided does not match what the API states. According to the docs, the following URL:
https://graph.facebook.com/v2.10/<page-id>/likes?access_token=<access-token>&summary=true
should return a JSON response with a summary key that provides the like count in the corresponding hash. The problem is the response never contains the summary key, but it does contain the data and pager keys as specified in the docs.
I'm certain my access token is valid and my page ID are correct.
I've also tried to get the page_fans metric from the page insights via the following URL, but it simply returns an empty data object.
https://graph.facebook.com/v2.10/<page-id>/insights/page_fans?access_token=<access-token>
Is there another way to go about retrieving the like count for a page or any particular reason that the requests would succeed, but be missing the relevant data?
Facebook Doc Links:
https://developers.facebook.com/docs/graph-api/reference/v2.10/object/likes
https://developers.facebook.com/docs/graph-api/reference/v2.8/insights
UPDATE
I was able to retrieve the count by using this Graph API call:
https://graph.facebook.com/v2.10/<page-id>?access_token=<access-token>&fields=engagement
As New Hand pointed out, you can get the key directly, without going through the engagement field using the following:
https://graph.facebook.com/v2.10/<page-id>?access_token=<access-token>&fields=fan_count
Do you mean to get the fan_count?
Please try this:
https://graph.facebook.com/v2.10/<page-id>?access_token=<access-token>&fields=fan_count

Recording GET requests to a table from REST API

I would like to record the various GET requests to my API in a table and use that table as part of the calculation of what to return for future GET requests.
Perhaps the easiest test example would be a GET function that returns the number of GET requests in the last hour.
The REST protocol says that GET requests should only have data returns.
Do I need to POST the request and then GET the results of the same request?
You can easily achieve that with nodejs
You should have the requests saved in a json file or database for example and have another service that returns this saved data.
Take a look at expressjs
Best luck