How to paginate with string provided in JSON result? - json

I am using Feedly API to access feeds from a particular rss feed. Take a look at this link (1). As you see, it only returns newest 20 items but I think it provides sort of a link to paginate to the next result. There is 'continuation' key provided in the result but it is a string and not a link.
How can I use that to fetch the next result? Is this even possible?
JSON response from the server

See http://developer.feedly.com/v3/streams/
You can pass the continuation key to get the next batch of results.
For example: https://cloud.feedly.com/v3/streams/contents?streamId=feed/http://feeds.engadget.com/weblogsinc/engadget?continuation=14de41de03e:f7bda:87649ed8

Related

Delete from json without the use of a 'real' id

In Angular:
I'm trying to delete items from a local json server using a http request.
The problem is that the items don't have 'real' id's. Their id's are strings which json doesn't recognises as id's (so far I know).
So when I try to search for an id (either to get it or delete it) I have to use for example:
"http://localhost:3000/watchlist?imdbID=tt5745872"
which gives an array with 1 item.
When using this in a delete request, it will result in a 404.
I was wondering if there is some kind of a workaround for doing this or do I really have to implement 'real' id's?
Context: I'm getting movies from an API and I then store those in an json server. As the API uses string id's, it would be a pain in the ass to try and implement a second id for the same object.

Unable to retrieve item count for Sharepoint List through Microsoft Graph API

I am currently using the Microsoft Graph API to return data in JSON for a specific list through this URL:
https://graph.microsoft.com/v1.0/sites/{siteID}/lists/{listID}/items/{itemID}
I would like to return data for all the items in the list by iterating through the itemID which is a number like 1,2,3. Although I can do that, I don't know what number to iterate to - does anyone know the API call or the URL for getting the item count in a list. If I send a GET Request to the following URL:
https://graph.microsoft.com/v1.0/sites/{siteID}/lists/{listID}/items
I only get back 235 list item JSON objects (much less than the 1200 that actually exist in the list) so I can't read off the last json object ID as the count.
I can do a while loop till I get an 'id doesn't exist error' but there are some items that are being regularly deleted hence I may encounter the same error there as well.
It can retrieve only few items when sending the API query (100-200) items. So try to use the $top query parameter
Using top query parameter. You are able to retrieve maximum 3000 items using Graph API
https://graph.microsoft.com/v1.0/sites/{siteID}/lists/{listID}/items?$top=3000
Upvote if accepted as a answer

Wikipedia Mediawiki API get URL in query

Using the MediaWiki API I have a query that returns the results I want:
https://en.wikipedia.org/w/api.php?action=query&list=allpages&apfrom=Apple&aplimit=5
How can I modify it to also include the URL for each of the pages that are returned?
I tried adding the "info" property and "url" info, but it does not return additional information:
https://en.wikipedia.org/w/api.php?action=query&list=allpages&apfrom=Apple&aplimit=5&prop=info&inprop=url
You need to move the parameters you use to get the result to a generator instead of a list and then use prop=info and inprop=url in the query. Like this:
https://en.wikipedia.org/w/api.php?action=query&format=json&prop=info&generator=allpages&inprop=url&gapfrom=Apple&gaplimit=5

Unable to retrieve unlimited number of record via API

We are struggling to mine all time records for this year via API.
We have tried to include the :dont_limit_result GET variable and set it to 1, however it did not help us.
The version that we use is ACTIVE COLLAB 5.11.0, the URL we are hitting: projects?dont_limit_result=1&page=$page
Please give me some advise on how to proceed.
Most of API responses are paginated, and pagination can't be turned off using a GET switch. Instead, you should check following headers:
X-Angie-PaginationCurrentPage - indicates current page
X-Angie-PaginationItemsPerPage - indicates number of items per page
X-Angie-PaginationTotalItems - indicates number of items in the entire data set.
and walk through pages until you reach the end of data set.
Another option is to give project's filter a try. Here's an example request that will return all projects:
curl -H "X-Angie-AuthApiToken: YOUR-API-TOKEN" "http://your.activecollab.com/api/v1/reports/run?type=ProjectsFilter"
This one will return all active projects:
curl -H "X-Angie-AuthApiToken: YOUR-API-TOKEN" "http://your.activecollab.com/api/v1/reports/run?type=ProjectsFilter&completed_on_filter=is_not_set"
I'm using the php API wrapper 3.0 - how do i get the headers back to know there are more pages and then what is the correct form of the query to get further pages?
For example my basic query is:
$timeRecords = $client->get('projects/22/time-records')->getJson();
to get time records - but this only returns 100 and there are more!
Thanks,
P

Displaying Album Info via JSON Facebook Graph API

I've been looking through the different threads on the Facebook Graph API and displaying the results via JSON. The examples are great but I only want to output the info for a particular album not loop through various results.
Here is a link to the Coca-Cola Wall Photos album. https://graph.facebook.com/99394368305
What I would like to do is display the Name of the Album and the Link.
Any help is much appreciated!
You can choose only the fields you want by specifying the fields query parameter:
https://graph.facebook.com/99394368305/?fields=name,link
From http://developers.facebook.com/docs/reference/api/#reading:
Selection
By default, most object properties are returned when you make a query. You can choose the fields (or connections) you want returned with the "fields" query parameter. For example, this URL will only return the id, name, and picture of Ben: https://graph.facebook.com/bgolub?fields=id,name,picture
You can also request multiple objects in a single query using the "ids" query parameter. For example, the URL https://graph.facebook.com?ids=arjun,vernal returns both profiles in the same response.