2

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?

Robert Harvey
  • 198,589
  • 55
  • 464
  • 673
  • 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 02: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 09:41

2 Answers2

3

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

gnat
  • 21,442
  • 29
  • 112
  • 288
Basile Starynkevitch
  • 32,434
  • 6
  • 84
  • 125
  • 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.

DougM
  • 6,361
  • 1
  • 17
  • 34