why the Graph API - Searching( https://graph.facebook.com/search) only send me 25 results - api

Hi I working with the Graph API - Searching (https://graph.facebook.com/search) and every time send me only 25 results and want to know how I can get more of 25 and maybe filter by date.
I hope you can help me

Look at the Paging in the Graph API documentation. Are you sending the "limit" parameter in the request? It looks like it is defaulting to 25 if you don't pass it and you get a paging object in the response which contains request URLs for the next/previous pages and you can use those to easily query the pages and show them.
Sample "paging" object in the search response:
"paging": {
"previous": "https://graph.facebook.com/search?q=orange&access_token=<your_access_token>&limit=25&since=1333151997&__previous=1",
"next": "https://graph.facebook.com/search?q=orange&access_token=<your_access_token>&limit=25&until=1333151781"
}

Related

Acumatica - Filter Generic Inquiry via REST

Trying to use this Generic Inquiry's REST API, I am able to retrieve all records though would like to filter them.
Can retrieve all data with PUT {{baseUrl}}/RawDataForReport?$expand=Result with an empty body request.
When I added a field Period to filter it's only showing the first row.
An empty request body also shows the first row when I added Period.
I am not at all familiar Acumatica any useful resources would be greatly appreciated.
To filter the Generic Inquiry result with REST API you need to add the filtering parameter to the GI itself. For instancce, you have your period filter defined in the Generic Inquiry. You can define more filters the same way.
You can learn about designing GIs here: https://openuni.acumatica.com/courses/reporting/s130-inquiries-reports-and-dashboards/
Another option would be to use OData instead of REST API. in that case you would be able to use $filter parameter to filter data.
You can read more about it here:
https://help-2020r2.acumatica.com/Help?ScreenId=ShowWiki&pageid=36beb9aa-f04d-4f63-a93b-a00b1c315be0
https://help-2020r2.acumatica.com/Help?ScreenId=ShowWiki&pageid=5d97a93d-45e0-466e-ba5e-77e1ccf96643
I've been struggling to find a solution to the same problem.
I just figured it out with the help of this stack overflow post.
Acumatica run Generic Inquiry via REST API
Take a look at the last response (not the accepted answer).
Basically when you define your object in the Web Service Endpoint screen, you can define the filters (Use Populate -> Filters). these are the Parameters for the GI.
You define the results the same as you have it.
Then in your PUT request body pass the parameters.
Example:
{
"Param1": {
"Value": "Value1"
},
"Param2": {
"Value": "Value2"
}
I just tested this with Postman, and it works well.

How to filter with "_links" properties params on API.v3 in openproject

I just learned to use "hypermedia rest API" on openproject
I want to use "filter" param with "_links" properties on API but not know-how
Example:
http:/<my_domain>/target/api/v3/projects/design/work_packages?filters=[{"updatedAt":{"operator":"<>d","values":["2017-06-10T22:00:00Z","2017-07-05T22:00:00Z"]}, "_links":{"type":{"title":{"operator":"=","values":["Box"]}}}]
==> My Question:
i not known use to "_links":{"type":{"title":{"operator":"=","values":["Box"]} params filter. Now, result is not filter for "_links"
And show me books name to learn API for to beginner
? (https://www.oreilly.com/library/view/restful-web-clients/9781491921890/ch04.html#callout_hal_clients_CO1-1) -> is this ok?
Help me, please!
Thanks!
Image for my api
What I understood you wanting to achieve is getting all work packages in the project "design" that have been updated last within a certain time interval and that are of the type "Box".
The filters in OpenProject do not differentiate between native properties (like updatedAt) and linked resources (like type) when it comes to the structure of the filters. The syntax is always
{"<name of the filter>": {"operator": "<operator>": "values": [<list of values>]}}
When it comes to the filter values however, there is a difference. For linked resource the client is expected to use the id whereas native value like an integer, string or date is required for the native properties.
For your request the above requires the client to issue the following query:
GET http://domain/target/api/v3/projects/design/work_packages?filters=[{"updatedAt":{"operator":"<>d","values":["2017-06-10T22:00:00Z","2017-07-05T22:00:00Z"]}}, {"type":{"operator":"=", "values":["10"]}}]
I took the id of 10 for the type "Box" out of the screenshot you provided.
To get the filter values of all available filter you can call
POST http://domain/target/api/v3/queries/form
with a body of
{"name":"default","_links":{"project":{"href":"/api/v3/projects/design"}}}
The response will list all available filters in the _embedded/schema/_embedded/filtersSchema array.

Retrieving image files from referenced items in filtered items

Being new to REST APIs (and APIs in general), I ran into some problems while trying to retrieve some Podio data using the Klipfolio web service, where I want to setup a simple dashboard with a list containing a name field from collected Podio and a image field from a reference field from the collected items.
So far I was led in the direction of 'bundling' and 'nesting', but I am not quite sure if this is the way forward.
In order to retrieve the filtered items, I have used the following POST method:
POST /item/app/11821547/filter/
Body:
{
"from": -1mr,
"to": -0mr
}
And then, from the items I here retrieve, I want to GET the referenced items, for instance using:
GET /reference/{ref_type}/{ref_id}
And finally, I want to get the image URL from the respective field in these referenced items, for instance using:
GET /item/{item_id}/value/{field_id}
Any help is much appreciated!!
To accomplish this you only need to use one API call to the Podio filter items endpoint in which you wrote above; POST /item/app/11821547/filter/.
In your POST body, you can filter down your results with the created to and from dates. For example, if you only want the items for the past month, you can use Klipfolio's date parameters. Your POST body will look like this:
{
"filters": {
"created_on": {
"from": "{date.addMonths(-1).format()}",
"to": "{date.today}"
}
}
}
This will return an API reponse of all items that were created within the past month. From here you can build a klip and manipulate the JSON with xpath expressions to extract the image urls and names. All this information will be within the #item/fields array in your API response. You'll have to determine which field ID is used for the name and image url field. These are unique to each account.
An example of xpath to extract these values would be like so:
#/items/fields[field_id='id_number']/values/value
Where id_number is the exact id number for the field.
If you are unfamiliar with xpath expressions within Klipfolio, here is a document that walks through this.

What is the proper way to format a GET request to retrieve all media items of the Instagram user "self"?

Looking at https://www.instagram.com/developer/endpoints/users/ I have gathered that calling https://api.instagram.com/v1/users/self/media/recent/?access_token=ACCESS-TOKEN will return "the most recent media published by the owner of the access_token."
In sandbox mode I understand that I will receive a maximum of 20 media items from this call. I also realize that the response code has a pagination object that I can use to retrieve up to 20 more media items (see below)
"pagination": {
"next_max_tag_id": "1387272337517",
"deprecation_warning": "next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead",
"next_max_id": "1387272337517",
"next_min_id": "1387272345517",
"min_tag_id": "1387272345517",
"next_url": "https://api.instagram.com/v1/tags/cats/media/recent?access_token=xxx&max_tag_id=1387272337517"
}
These are the listed parameters of this Request.
PARAMETERS
ACCESS_TOKEN A valid access token.
MAX_ID Return media earlier than this max_id.
MIN_ID Return media later than this min_id.
COUNT Count of media to return.
My question is: Is there a way to structure my GET request in a way that returns all media items from a single call? I understand that this is not possible in sandbox mode, given a user with more than 20 media items. If possible please provide a detailed explanation of the COUNT parameter.
I imagine a possible GET request would look like https://api.instagram.com/v1/users/self/media/recent/?access_token=ACCESS-TOKEN?COUNT=X
Thank you. <3
When you go live mode you can use the count= param to get more than 20 in one API call, however I have noticed that count=33 is the maximum you can get for this API call, even if you anything more than 33, it only returns 33.
You still have to use the pagination in JSON response to get the next set of media items, easiest way is to use the pagination.next_url to make API call and get next set of media items

How to retrieve Wikidata entry from Wikidata search results?

I make a Wikidata search request like this (autocomplete use case):
https://www.wikidata.org/w/api.php?action=wbsearchentities&format=json&language=en&type=item&continue=0&search=photog
And the service returns a JSON response thus
{
id: "Q11633",
url: "//www.wikidata.org/wiki/Q11633",
description: "art, science and practice of creating durable images by recording light or other electromagnetic radiation",
label: "photography"
}
But how do I look up to get retrieve the content?
I can only find a title search which does not recognize the Q parameter. It only recognizes titles.
https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&titles=Photography
You want to use wbgetentities, another method of WikiData's extension to the MediaWiki API (WikiBase). In its most basic form, it looks like this:
api.php?action=wbgetentities&ids=Q11633
You probably want to reduce the size of the reply, by specifying what you what to know about the entity, using the props parameter.