mca
http://amundsen.com/blog/
http://twitter.com@mamund
http://mamund.com/foaf.rdf#me
What makes sense for return code if user already exists
and (a) is still in trial period, or (b) trial period has ended?
> Care to share some of the more compelling reasons against 200 from
> your internal discussion?
Not part of the discussion you reference, but in working with my own consumers I've found that returning 200 and an error message caused problems in something rather like the original case 'b' ("trial period exhausted and insufficient info provided to create a paid account"). The problems arose from consumers coding to my API from the .NET framework. As it happens, I'm a Rails programmer, with no experience in .NET, so I'm not at all sure that I understand the nature of the problem reported, but the comment I got back from one user who had eventually figured it out was "I had to put in an extra loop."
What I take from this is that there was additional code needed to grub out the error message, and since the return status was OK he hadn't expected any error message, and hadn't written that code. For this reason, I try to make a return of "OK" mean "the thing you requested worked." Contrary to suggestions elsewhere in this thread, I do not separate transport-level failures from application-level errors, but rather treat basic notions like "success" or "failure" (2XX vs. 4XX returns) as global.
That doesn't help in choosing which 2XX or 4XX to return, of course. My reflex is to be "unsurprising," and that tends to rule out "subtle." If any old 4XX means "look at the error message for details," then have you really advanced matters any by returning the highly nuanced 402 "Payment required"?
You report that Apple has been known to use 402. Well, speaking as a certifiable Apple Fanboi, I gotta say ... Apple seems to adopt yet another new data connector, for disc or screen or something or other, with every new device they design. Five friends and I spent almost half an hour, yesterday, trying to string together dongles to connect an Apple laptop or iPad or the two together to a large-screen TV. There are many things I love about Apple, but the "really really no this time really even perfecter than last time connector for the same data standard" syndrome is not high on my list.
Jack Repenning
I do not know what I may appear to the world; but to myself I seem to have been only like a boy playing on the sea-shore, and diverting myself in now and then finding a smoother pebble or a prettier shell than ordinary, whilst the great ocean of truth lay all undiscovered before me.
-- Sir Isaac Newton