I created a curl command using the example in your API Documentation:

---- CURL COMMAND START -----

curl -v -H 'X-Auth-Service-Provider: 
https://api.twitter.com/1/account/verify_credentials.json'
-H 'X-Verify-Credentials-Authorization: OAuth realm="http://
api.twitter.com/", oauth_consumer_key="9tMgFXW0rFtb2YLrBIFbIQ",
oauth_signature_method="HMAC-SHA1", oauth_token="69570246-
r0Z9nrgf5OKy2qyrTyOSKzvJn75hO2RcLurK9H3S8",
oauth_timestamp="1274766777", oauth_nonce="19583AFE-D5AD-4DD7-BAF7-
E842254D1CA7", oauth_version="1.0", oauth_signature="RidHgN2dR4NZNJMq
%2FSrfFuPN1HQ%3D%3D"' -F "key= xxxxxxxxMYAPPKEYxxxxxxxx" -F "med...@./
Picture11.png" http://api.twitpic.com/2/upload.json

---- CURL COMMAND END -----

And the response i keep getting is:

------ RESPONSE START --------
* About to connect() to api.twitpic.com port 80 (#0)
*   Trying 174.36.58.233... connected
* Connected to api.twitpic.com (174.36.58.233) port 80 (#0)
> POST /2/upload.json HTTP/1.1
> User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 
> OpenSSL/0.9.7l zlib/1.2.3
> Host: api.twitpic.com
> Accept: */*
> X-Auth-Service-Provider: 
> https://api.twitter.com/1/account/verify_credentials.json
> X-Verify-Credentials-Authorization: OAuth realm="http://api.twitter.com/";, 
> oauth_consumer_key="9tMgFXW0rFtb2YLrBIFbIQ", 
> oauth_signature_method="HMAC-SHA1", 
> oauth_token="69570246-r0Z9nrgf5OKy2qyrTyOSKzvJn75hO2RcLurK9H3S8", 
> oauth_timestamp="1274766777", 
> oauth_nonce="19583AFE-D5AD-4DD7-BAF7-E842254D1CA7", oauth_version="1.0", 
> oauth_signature="RidHgN2dR4NZNJMq%2FSrfFuPN1HQ%3D%3D"
> Content-Length: 1831
> Expect: 100-continue
> Content-Type: multipart/form-data; 
> boundary=----------------------------e33c68df21fa
>
< HTTP/1.1 100 Continue
< HTTP/1.1 401 Unauthorized
< Server: nginx
< Date: Tue, 25 May 2010 05:52:06 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: PHP/5.3.2
<
* Connection #0 to host api.twitpic.com left intact
* Closing connection #0
{"errors":[{"code":401,"message":"Could not authenticate you (header
rejected by twitter)."}]}

------ RESPONSE END --------


can you please tell me what am i doing wrong so i can integrate the
Oauth Functionality in my twitpic app ASAP.

Thanks!

On May 22, 12:14 pm, Rich <rhyl...@gmail.com> wrote:
> The request to verify_credentials should be a GET and shouldn't
> contain any of the parameters you intend to send to TwitPic either
>
> On May 22, 4:51 am, Miguel de Icaza <miguel.de.ic...@gmail.com> wrote:
>
>
>
> > Hello,
>
> > > 1) You do not oAuth sign the actual request toTwitPic
> > > 2) You make a fake request to Twitter's verify credentials api over
> > > SSL and grab the Authorization header that would be sent, however when
> > > you create the header make sure you include a 'Realm' 
> > > ofhttps://api.twitter.com
> > > 3) Create a new post request toTwitPicand put the oAuth header that
> > > you grabbed from Authorization in the HTTP header X-Verify-Credentials-
> > > Authorization
> > > 4) Add a X-Auth-Service-Provider header with the URL to verify
> > > credentials.
> > > 5) You should be good to go after that
>
> > I tried this, but I am getting the following message from TwitPic:
>
> > "could not authenticate you (header rejected by twitter)"
>
> > I created the OAuth headers as if I was trying to send an OAuth
> > request tohttps://api.twitter.com/1/account/verify_credentials.json
> > and added those headers to X-Verify-Credential-Authorization
>
> > The headers contain realm "http://api.twitter.com"; (tried also with
> > https)
>
> > Any ideas what "Header rejected by twitter" means?
>
> > > If you get the signature right, it will work as I and a few others
> > > have got it working when we were liasing with their engineers on
> > > Sunday
>
> > > On May 19, 3:41 am, uprise78 <des...@gmail.com> wrote:
>
> > > > I'm in the same boat.  My call to Twitter works fine but I get 401's
> > > > fromTwitPicevery time.

Reply via email to