As the fql query is part of the request url (e.g. http://graph.facebook.com/fql?q=SELECT...) i suppose there is a limit for the length of urls (or their params)?
There is no documented or announced limit on the length of the FQL query itself, but there is a limit on the length of the query string (which is different across browsers and web-servers, see Compatibility issues).
Mind that you are not required to use GET to run a query and POST will be working fine allowing you to avoid the query string limit.
BTW, if you'll use SDK to issue FQL queries you may specify the appropriate HTTP method manually
Using JS-SDK:
FB.api('/fql', {q:'FQL_QUERY'}, 'post', function(response){
// Handle results
});
Using PHP-SDK:
$response = $fb->api('/fql', 'post', array('q'=>'FQL_QUERY'));
Related
So here is my case, I am trying to implement concurrency test using jMeter with over 100 users. I got the foundation set up. However, the challenge I am encountering is that I have two APIs on postman one which I need to get accident case as UIID that is the first API and the second API is an API in which I register the accident. Each accident api requires different accident case. In other words, all 100 users will have different accident case. I usually do that manually when manual test but how do I do that automated in jMeter
enter image description here
Thank you and best regards
You can use __UUID
"accidentCase": "${__UUID()}",
The UUID function returns a pseudo random type 4 Universally Unique IDentifier (UUID).
If you're getting an accident case in 1st request and need to use it in 2nd request you can extract it from the 1st request response using a suitable JMeter Post-Processor and save it into a JMeter Variable
Then in 2nd request you need to replace the 21d2a592-f883-45f7-a1c4-9f55413f01b9 with the JMeter Variable holding the UUID from the first request.
The process is known as correlation and there is a lot of information on it in the Internet.
I tried to use something like g.with_('evaluationTimeout', 1) but it does not seem to work
Assuming you are using one of the Gremlin GLV clients, then a query such as this one (Python in this case) will apply the per query timeout. Note that the longer form scriptEvaluationTimeout was deprecated in favor of the shorter form evaluationTimeout
g.with_('scriptEvaluationTimeout',5).V().count().next()
or
g.with_('evaluationTimeout',5).V().count().next()
If the query times out, you will get an exception that includes as message such as:
gremlin_python.driver.protocol.GremlinServerError: 500:
{"detailedMessage":"A timeout occurred within the script during evaluation.","code":"TimeLimitExceededException","requestId":"9ec1e462-f47f-4876-8157-c0bf3c06ec6b"}
I would like to request the following Instagram Insights metrics using a single graph API call:
follower_count
audience_gender_age
The problem I am facing is that follower_count requires a period parameter 'day' and audience_gender_age a period parameter 'lifetime'. I have tried to merge them in a single API call, but this is not supported by Facebook:
/XXXXXX/?fields=insights.metric(follower_count).period(day),insights.metric(audience_gender_age).period(lifetime)
I there a proper way to request these metrics using different periods in a single API call?
If you need to request data from the same field twice in one query, that can be done using the .as(name) aliasing syntax, https://developers.facebook.com/docs/graph-api/aliasing-fields
Quote docs,
For example, you can retrieve an image in two sizes and alias the returned object fields as picture_small and picture_larger:
me?fields=id,name,picture.width(100).height(100).as(picture_small),
picture.width(720).height(720).as(picture_large)
I am trying to get a list of our streams from Akamai's Media Services API v1; however, I'm only getting a 504 Gateway Timeout. I believe this is due to the amount of streams being queried for, as I can get a single stream when I give the ID for the GET stream/{streamId} endpoint.
I am using the edgegrid node module and have tried adding query parameters such as limit, pageSize/page-size, and stream-name/streamName to limit my results to no avail.
Is there a way to limit the results in a query for this API?
edit:
We are using v1 of the API
If you're using v2 of the API, it should automatically return the results paged. The API endpoint /config-media-live/v2/msl-origin/streams includes the ability to specify query string parameters page and pageSize. page is an integer that tells the API which page number to return. pageSize is also an integer referring to the number of entries the page should contain.
Example: /config-media-live/v2/msl-origin/streams?page=2&pageSize=10&sortKey=createdDate&sortOrder=ASC
My app download all the user's friends pictures.
All the requests are of this kind:
https://graph.facebook.com/<friend id>/picture?type=small
But, after a certain limit is reached, instead of the picture I get:
{"error""message":"(#4) Application request limit reached","type":"OAuthException"}}
Actually, the only way I found to prevent this is to change the server ip (manually).
There isn't a better way?
For the record:
The limit is related to the Graph Api only, and the graph.facebook.com/<user>/picture url is a graph api call that returns a redirect.
So, to avoid the daily limit, simply fetch all the images url from FQL, like:
SELECT uid, pic_small, pic_big, pic, pic_square FROM user WHERE uid = me() or IN (SELECT uid2 FROM friend WHERE uid1=me())
now these are the direct urls to the images, for eg:
http://profile.ak.fbcdn.net/hprofile-ak-snc4/275716_1546085527_622218197_q.jpg
so don't store them since they continuously change.
If it's needed for an online app better way not to download those images, but use an online version, there is couple of reasons for doing so:
Users change pictures (some frequently), do you need an updated version?
Facebook's servers probably faster than yours and friends pictures probably cached within browser of your user.
Update:
Since limit you reach is Graph API call limit, not the image retrieval, another solution that comes to my head just now is using friends connection of user in Graph API and specifying picture in fields argument, eq: https://graph.facebook.com/me/friends?fields=picture, this will return direct URL-s for friends pictures so you can do only one call to get all needed info to download the images for every user...