I am still learning about API fetching. I want to get a list of values instead of just one value.
I am currently calling this API https://www.omdbapi.com that returns a movie based off the name or id:
http://www.omdbapi.com/?t=nameOfMovie
When calling that url with something like 'batman' it returns one json value of one of the batman movies. How would I be able to fetch a list? Or would that be entirely up to the people who run the API?
Related
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.
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
When I make a Https GET call, the following JSON is returned
{"-KXprfmbpX6dEqXLU1z_":{"Pizzatype":"Margarita"},"Toppings":{"-KXprfm_PBdOYUYiWzkK":["Onions","Mushrooms"]}}
I want to retrieve the values of Pizzatype and Toppings. However I am not aware of the real time keys -KXprfmbpX6dEqXLU1z_ , -KXprfm_PBdOYUYiWzkK. I am coding in an online Bot building platform in Node. How can I retrieve these values?
I'm working on a C# program that retrieves data from a ServiceNow database and converts that data into C# .NET objects. I'm using the JSON Web Service to return my data in JSON format.
What I want to achieve is as follows: If there is a relational mapping between a value (for
example: I have a table called Company, where CEO is not a TEXT field but an sys_id to a Employee Table) I want to be able to output that data not with an sys_id (or just displaying the name property by using the 'displayvariable' parameter) but by an object displayed in JSON.
This means that the value of a property should be an object in JSON instead of just a single value.
A few examples:
// I don't want the JSON like this
{"Company":{"CEO":"b181e841c9212c008aeb36850331fab2"}}
// Or by displaying the name of the sys_id table
{"Company":{"CEO":"James Henderson" }}
// I want the data as follows, so I can have all the data I need inside a single JSON record.
{"Company":{"CEO":{"name":"James Henderson", "age":34, "sex":"male", "office":"SBN Left Floor 23"}}}
From reading the documentation I couldn't find anything in the JSON Web Service that allowed me to display the information like this nor
find any other alternative. It should have something to do with joining the tables and displaying it all in the right format.
I have been using SNC for almost three years and have not found you can automatically join tables in a web service. Your best option would be to use a scripted web service which possibly takes a query parameter and table parameter. Then you can json serialized your result as you see fit.
Or, another option would be to generate a new processor that will traverse the GlideRecord object. The ?JSON parameter you pass in to the URL is merely a flag to pass your request to a particular processor. Unfortunately the OOB one I believe is a Java class not a JS script, so you would need to write a script much like I mentioned earlier to traverse the object path serializing the object graph as far down as your want to go.
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.