I would like to retrieve only the events in a hash from February 14 wiki page
For that I am trying this JSON API call but it does not give clear information. How can I imrovise my api call to get all events list in a proper way. I would like to store this info in db as object like key, value pair.
Use parameters prop=revisions, rvprop=content and set rvsection ID to the API call. In your case, the section ID for Events is 1, so the API call will be:
https://en.wikipedia.org/w/api.php?action=query&titles=February_14&prop=revisions&rvprop=content&format=json&rvsection=1
Related
I have extracted a variable called id from a get request which have multiple ID's data so I have used json extractor used the path $..id and match no as -1
Now I wanted to use this id data in other two post api urls in a 2 for each controller, (one controller for one api)
i have given input prifix as id and strat index 0 end index ${id_matchNr} and the output variable name as tug,
the 2 post url is something like https://demo.qwe.com/red/{tug}
https://demo.qwe.com/blue/{tug}
I want to send 2 different values to these APIs for each iterations, but when I run it's taking same tug value for both the url paths for each iteration.
I tried giving both the post APIs in one foreach controller, still the same problem.
Please Help me out
If you're using ForEach Controller with the described configuration you will be able to refer the current value as ${tug}
When it comes to the next value you need to calculate the incremented value of ${id_x} JMeter Variable using current iteration of the ForEach Controller using __intSum() function and use __V() function to evaluate the variable value.
Something like:
${__V(id_${__intSum(${__jm__ForEach Controller__idx},2,)},)}
should do the trick for you.
More information: Here’s What to Do to Combine Multiple JMeter Variables
I am currently trying to create a JSON Schema for every controller my API shows in public.
In all my controllers, I have a java object behind them. I use my object's fields to get guided for the creation of each JSON Schema.
But I also have 1 controller, used to keep statistics (ratings, favourites) which doesn't have a java object behind it. This controller has only GET methods.
For example, let's talk about ratings. It accepts an id for the object I want to see its rating, plus an interval (Day, Month, Year), it executes some operations and it returns a Map like this:
{
"2018-12": 2.5,
"2019-01": 3.8333333,
"2019-02": 3,
"2019-03": 3,
"2019-04": 3,
"2019-05": 4,
"2019-06": 3,
"2019-07": 2
}
So in 2018-12 the object with the specific id got 2.5 ratings in total.
And to be more specific.
In the UI, when a user rates something, I call another controller called EventController. This controller saves who rated, when and what he rated. When I want to see a specific rating, I call the StatsController. StatsController calls StatsManager which get the info required (from EventManager), execute its operations and create the rating it' ll finally show to the user.
But my EventController is #ApiIgnore on the API. That means it doesn't appear in the API, so I don't need a JSON Schema for the Event.java class. I need for the Stats though.
How can I create a JSON Schema for my Stats Controller? Is it even possible to create a schema if you don't have a java object?
I hope I explained it well.
Thank you!
I followed the instructions outlined in
https://forge.autodesk.com/blog/get-all-dbid-without-enumerating-model-hierarchy
I am able to get the model object tree and see the object id's i want to get properties for.
but when i take the object id and submit a query parameter i get a 404 status code back.
the text on the request returns :
{"message":"The requested model contains too many objects to retrieve hierarchy/properties. Please contact your next level support for further assistance."}
sample of my query in python to the end point
Sample query
The Box v2 REST API appears to contain methods that return "full objects". That is, they return all the fields and properties of the object requested with one "simple" call.
When trying the official .Net SDK, it appears that if you don't specify fields by name in the "FoldersManager" or "FilesManager" (for example), you get minimal details of the objects returned.
Is there a way to make the request return all fields/properties? I realize maybe ItemsCollection is one you'd want to retrieve specifically, but the rest should really be included in one call (like the REST capability).
Thanks for any ideas!
-AJ
If no fields are specified in the request, the default fields are returned in the response (ie. what the API decides is the most commonly used fields). If a field is specified the API returns all required fields along with the specified fields (usually type, id, and etag).
There is currently no simple flag that will return all fields as this would likely be abused out of convenience. The only way to return all fields is to manually specify all of the fields you are looking for. If using any of the official SDKs, these fields names can usually be found in the object models
HTH
I am using JSON GRAPH API for facebook to retrieve all the post from a particular group. I can access all the post without authentication. However the problem I have is, if a particular post has more comments (like 10) then JSON outputs shows only 3 comments(not all 10). However the "Key" "Count" in JSON output gives the value as 10(meaning 10 comments for the post) but displays only 3. How to resolve this problem.
ANy help is greatly appreciated...!!!
In that json data set there is a a key named 'paging' that gives you the next and previous sets ('next' and 'previous' respectively). You can use those urls to traverse all comments.
See the section named 'Paging' in the docs here: http://developers.facebook.com/docs/api?ref=mf for more stuff (like limits and time queries)