So I’ve gotten through the Quote project and am working through the weather project now.
In both instances I’ve gotten the API URLs to work (once they are working the projects come together pretty easily and are fun), but not without looking up tutorials first. I’m having a lot of trouble figuring out how to make the URLs from reading just the official api documentation.
Can anyone recommend some tutorials / videos for APIs and their URLs / $.getJSON / $.ajax in general? I don’t want to depend on tutorials specifically for each API i find myself using and would love to be able to figure out how to get them to work on my own.
awesome thanks for the resources, I’ll check it out!
Mainly I get what to do with the API and sort of how it works, it getting me back an object I can manipulate… but when it comes to the URL and stuff, I try to look through the api documentation to try to build my url query string but get tooootally lost
the Udacity course on AJAX/APIs helped me a lot. Though if you’re already done with the quote project you might have already gotten most of what it helped me with.
every API is different. The opening stages of a project have a lot to do with figuring out how this one works, how it wants you to treat it, and what it can give back. The weather app has a lot of issues depending on which API you choose. The Wikipedia API turns out to be about 200 different APIs that do different things and accept different parameters. The Twitch app, as well, requires more steps than one might assume.
as p1xt said, the API is just the beginning. In a more complicated app, you'll find a lot of the work to be done is just figuring out its internal mechanics, the Rube Goldberg machine that makes the data show up over there, which makes that other thing do that, and then when you click that it does that with the data and also makes the first thing do that thing.
Sorry to answer my own question, but I’ve just thought of something that was perhaps obvious, but worth sharing as a good idea.
I’m in the middle of debugging my implementation of an ajax request with chrome dev tools.
It was simple, I prepared a variable (using jquery btw)
var dummyresponse;
and in the ajax call I simply saved the response