Re: [twitter-dev] friendships/create method and 403 ambiguity

2009-12-15 Thread Marcel Molina
In the long term we plan to add internal error codes to every non 2**
response so that the consumer can unambiguously know what error they got
without munging error message strings (who's language might be changed
innocently not knowing the consequences).

On Mon, Dec 14, 2009 at 2:42 PM, Mark McBride mmcbr...@twitter.com wrote:

 The body of the response allows you to differentiate these two codes, e.g.

 curl -ucredentials -XPOST -d 
 http://twitter.com/friendships/create/atebits.xml
 ?xml version=1.0 encoding=UTF-8?
 hash
  request/friendships/create/atebits.xml/request
  errorCould not follow user: atebits is already on your list./error
 /hash


 On Mon, Dec 14, 2009 at 2:38 PM, shiplu shiplu@gmail.com wrote:
  There are two phrases about friendships/create.
 
  1.  If you are already friends with the user an HTTP 403 will be
 returned.
  2.  This method is subject to [1]update limits. An HTTP 403 will be
  returned if this limit as been hit.
 
  How to differ those two status codes?
 
 
  [1] http://help.twitter.com/forums/10711/entries/15364
 
  --
  A K M Mokaddim
  My talks, http://talk.cmyweb.net
  Follow me, http://twitter.com/shiplu
  Innovation distinguishes bet ... ... (ask Steve Jobs the rest)
 



 --
   ---Mark

 http://twitter.com/mccv




-- 
Marcel Molina
Twitter Platform Team
http://twitter.com/noradio


Re: [twitter-dev] friendships/create method and 403 ambiguity

2009-12-15 Thread shiplu
On Wed, Dec 16, 2009 at 6:02 AM, Marcel Molina mar...@twitter.com wrote:
 In the long term we plan to add internal error codes to every non 2**
 response so that the consumer can unambiguously know what error they got
 without munging error message strings (who's language might be changed
 innocently not knowing the consequences).

That'd be great. Currently I am using regular expression
/Could\s+not\s+follow\s+user/i
If there was any header like X-API-STATUS or  X-TWITTER-ERRNO it'd be
so easier to handle error.

Thanks

-- 
A K M Mokaddim
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://groups.google.com/group/p2psust
Innovation distinguishes bet ... ... (ask Steve Jobs the rest)


[twitter-dev] friendships/create method and 403 ambiguity

2009-12-14 Thread shiplu
There are two phrases about friendships/create.

1.  If you are already friends with the user an HTTP 403 will be returned.
2.  This method is subject to [1]update limits. An HTTP 403 will be
returned if this limit as been hit.

How to differ those two status codes?


[1] http://help.twitter.com/forums/10711/entries/15364

-- 
A K M Mokaddim
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
Innovation distinguishes bet ... ... (ask Steve Jobs the rest)


Re: [twitter-dev] friendships/create method and 403 ambiguity

2009-12-14 Thread Mark McBride
The body of the response allows you to differentiate these two codes, e.g.

curl -ucredentials -XPOST -d 
http://twitter.com/friendships/create/atebits.xml
?xml version=1.0 encoding=UTF-8?
hash
  request/friendships/create/atebits.xml/request
  errorCould not follow user: atebits is already on your list./error
/hash


On Mon, Dec 14, 2009 at 2:38 PM, shiplu shiplu@gmail.com wrote:
 There are two phrases about friendships/create.

 1.  If you are already friends with the user an HTTP 403 will be returned.
 2.  This method is subject to [1]update limits. An HTTP 403 will be
 returned if this limit as been hit.

 How to differ those two status codes?


 [1] http://help.twitter.com/forums/10711/entries/15364

 --
 A K M Mokaddim
 My talks, http://talk.cmyweb.net
 Follow me, http://twitter.com/shiplu
 Innovation distinguishes bet ... ... (ask Steve Jobs the rest)




-- 
   ---Mark

http://twitter.com/mccv