1

I heard that twitter practices "dogfooding," meaning that they use their own API for the website. However, I don't really understand how that's true. When I use Firebug, I see that all the AJAX calls are made to some URL like:

https://twitter.com/{username}/{whatever else}

Rather than:

https://api.twitter.com/1.1/statuses/...

If they are using different URL's, how are they using their own API? I think I have the wrong notion of what an API is... Also, how would it work with OAuth? Do they validate themselves?

migrated from stackoverflow.com Aug 27 '14 at 9:28

This question came from our site for professional and enthusiast programmers.

  • 1
    It means using your own product to test. You code for android, use your code on all of the company's phone. Find and fix problems. Facebook uses the Facebook for the company's internal business communication. – jim mcnamara Aug 21 '14 at 2:36
  • 3
    They might be calling the api from their web server, so the client (your ajax request) would only see the call to their servers. – George Duckett Aug 27 '14 at 9:41
3

Twitter is definitely able to configure their web servers so that some HTTP requests are going (thru a "private route") to their "API".

  • This practice is call "routing" in the rails community. Its a feature of the web server. Basically, the server can traslate anything goin to https://twitter.com to api.twitter.com, though I suspect that the dogfooding they are doing would pipe it to a dev-branch of the API rather than the public API. – IdeaHat Sep 26 '14 at 13:16
0

If they are using different URL's, how are they using their own API?

An API is software, while a URL points to a particular instance of said software. It's perfectly sensible to have different installations of the same program for different audiences, exactly the same as Microsoft's internal git server being different than your own.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy