If we really get to pick from a clean slate, I'd say:

  POST http://api.twitter.com/1/users/bob/statuses/?format=xml
  POST http://api.twitter.com/1/users/bob/statuses/?format=atom
  POST http://api.twitter.com/1/users/bob/statuses/?format=json

But the current way of posting to the global status pool isn't entirely
non-RESTful, it's just a little less discoverable.   Because I'd also expect
these two calls to be equivalent:

  GET http://api.twitter.com/1/statuses/users/bob/?format=json
  GET http://api.twitter.com/1/users/bob/statuses/?format=json

So by that logic, this should still work:

  POST http://api.twitter.com/1/statuses/?format=json  (using the currently
auth'ed user)

The other change I made of course was moving the format to a parameter,
rather than in the filename extension in the URL.

Perhaps version belongs in the parameters (instead of the path) as well?
E.g.:

  POST http://api.twitter.com/users/bob/statuses/?format=json&version=1

Just a few thoughts off the top of my head...

-DeWitt

On Mon, Oct 13, 2008 at 5:11 PM, Alex Payne <[EMAIL PROTECTED]> wrote:

>
> I'm sitting down with @mzsanford this week to spec out what we're
> calling the "API Service" internally, the next version of the Twitter
> API.  We're going to have a number of questions that we want your
> feedback on, and this is the first.
>
> Currently, the URL to which you POST to update a user's status is this:
>
>  http://twitter.com/statuses/update.format
>
> This breaks RESTful conventions and is generally a bit ugly.  We're
> considering one of the following, either:
>
>  POST http://api.twitter.com/1/statuses.xml
>
> ... or:
>
>  POST http://api.twitter.com/1/users/bob/statuses.xml
>
> The difference is all in RESTful semantics.  In the first case, you're
> POSTing a new status to the universal collection of statuses.  In the
> second case, you're POSTing a new status to user bob's collection of
> statuses.
>
> Which do you all prefer and why?  Alternatives welcome.
>
> --
> Alex Payne - API Lead, Twitter, Inc.
> http://twitter.com/al3x
>

Reply via email to