Hello,
This is my first time using web api component
and i am making an app which gives random quotes
I am using goquotes api.
It gives a null value while running it; please help me
You need to provide more information.
Have you setup the Web API
component with the requirements of your API service?
Is the API working fine from the browser directly?
If the API requires special setup, have you tested it with an API client such as Postman
?
[Update]
I ran a quick test using the API in the browser and I get results.
{"status":200,"message":"success","count":3,"quotes":[{"text":"Money will buy a pretty good dog, but it won't buy the wag of his tail.","author":"Josh Billings","tag":"money"},{"text":"I am a morning writer I am writing at eight-thirty in longhand and I keep at it until twelve-thirty, when I go for a swim. Then I come back, have lunch, and read in the afternoon until I take my walk for the next day's writing.","author":"Carlos Fuentes","tag":"morning"},{"text":"A gentleman is simply a patient wolf.","author":"Lana Turner","tag":"men"}]}
yes it works in the browser very fine
Are you talking about the query parameters? if yes; I haven’t
Because I don’t know form where should we enter the values
Can you share an image of the blocks you have for the Web API
?
Their GitHub page has the following note:
Note : The api will not work as it was hosted under free tier at Heroku & it has been exhausted due to high traffic. So clone and host your version of API and test them
Then again, it does seem to be working in a browser.
When parsing the JSON response, you need to convert the green response block to an object. So attach the “get object from JSON” block to it.
Also, you’ll need to get the “quotes” property first and then from that result, take a list item from it and get the “text” property.
The green block response
is not an object, it is a JSON string.
The other thing is the quotes
object is a list so you need something like this to obtain the first quote of the list of quotes
Sample output
To avoid errors, you should first check that there is no errors then proceed with checking the status
thanks, and what will be the api url?
The same as you have in the image you sent.
I used this https://goquotes-api.herokuapp.com/api/v1/random?count=3
when I live test it the screen gets white
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.