Help get started programming with a web service's API
-
Can you recommend a tutorial to get started with web programming that interacts with APIs? I'm pretty handy with php, javascript, and HTML/CSS, but for some reason, working with a service's API is very confusing to me. I just can't seem to even get started. My goal is to connect my photo archive at photoshelter with google's image search to search out where my photos are being used. Both have APIs and I have the pseudocode idea about what I want to do, but I can't quite figure it out. I think any sort of API-focused tutorial would get me on the right track. API documentation never seems to be enough. I need something that has full code to do something simple (anything!) with any API (flickr would be fine, for instance) that also explains some of the steps. I just can't get my head around opening and authorizing a session with a service, sending requests, ending a session, etc. Also, I don't need this to live on a live web server. I'm happy using my own development environment or some other local solution.
-
Answer:
My biggest hurdle with learning new coding stuff has always been the cock-eyed way in which people tend to talk about stuff. For example, someone online or in a job req will be like "MUST KNOW XML" and it sounds like some intimidating language you need to learn. When in reality, it's just a list of information in a hierarchy, there's literally almost nothing to "know." By the same token, if you know how to make an AJAX request to your own server via jQuery or whatever, that's all an API is. Exact same thing, except the link is to someone else's webserver. If you want to start with something like getting someone's photos off flickr, it's all public for the most part and you won't need any kind of session. I'm sure all the resources above will help, but for me the first step is always a sort of demystifying. It's just a collection of concepts you are probably already quite familiar with. My only other caveat is that the documentation for the average public API tends to be awful. Sometimes you just have to guess at parameters and such until you get the result you want.
msbrauer at Ask.Metafilter.Com Visit the source
Other answers
You might find https://ffeathers.wordpress.com/2015/01/25/api-explorers-play-with-a-rest-api-the-easy-way/ on REST APIs useful.
neushoorn
This article, http://code.tutsplus.com/tutorials/demystifying-rest--pre-58000 and this video, https://www.youtube.com/watch?v=PgrP6r-cFUQ, helped me out.
backwards guitar
Codecademy has a bunch of lessons on working with APIs -- http://www.codecademy.com/learn and scroll down a bit.
ludwig_van
Actually I take back part of what I said, you do need an API key for flickr. But still if it was me, I would just google "flickr [or whatever] API jquery example," copy the code and tinker with it until it did what I wanted. I learn much better that way than through long tutorials full of abstract concepts, personally.
drjimmy11
I just can't get my head around opening and authorizing a session with a service, sending requests, ending a session, etc. Sessions are a whole different can of worms. Possibly the service you're trying to use is using OAuth/OAuth2? In that case I'd highly recommend using a library instead of trying to DIY. With a typical REST API, you shouldn't need to worry about sessions. For an easy one to get started, I'd recommend the https://developer.github.com/v3/ -- it's pretty sensible and doesn't require an authorization key (to up a certain number of requests). For example, https://api.github.com/users/Microsoft/repos.
neckro23
Related Q & A:
- How Can I Get Started As A Freelance Web Developer?Best solution by code.tutsplus.com
- How to deal with timeout when accessing a web service?Best solution by Stack Overflow
- How to call a web service using HttpWebRequest?Best solution by Stack Overflow
- how to consume a web service in mule flow?Best solution by Stack Overflow
- How do I forward gmail raw email to a web service?Best solution by email.about.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.