*slaps forehead*

DUH!

Thanks.  That worked.

-Jason

On Mar 31, 3:25 pm, Abraham Williams <[email protected]> wrote:
> An obvious issue ishttp://twitter.com/direct_messages/new.format.
>
> "format" should be either "json" or "xml".
>
>
>
> On Tue, Mar 31, 2009 at 14:17, Jason <[email protected]> wrote:
>
> > Hi,
>
> > As part of a Twitter Application I'm working on, I need to send a
> > direct message to a user.  My code for this is:
>
> > <?
> >        $twitterHost = "http://twitter.com/direct_messages/new.format";;
> >        $postdata = array("user" => $Username, "text" => "MESSAGE I AM
> > SENDING");
>
> >        $curl = curl_init();
>
> >        curl_setopt($curl, CURLOPT_URL, $twitterHost);
> >        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
> >        curl_setopt($curl, CURLOPT_USERPWD, $APIusername . ":" .
> > $APIpassword);
> >        curl_setopt($curl, CURLOPT_HTTPHEADER, array('Expect:'));
> >        curl_setopt($curl, CURLOPT_POST, true);
> >        curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
>
> >        set_time_limit(60); // Keep script from timing out
> >        $APIResult = curl_exec($curl);
>
> >        curl_close($curl);
> >        echo $APIResult;
> > ?>
>
> > $APIusername and $APIpassword are my Twitter Username and Password.
> > (I've been whitelisted.)  The response I get back is: "403 Forbidden:
> > The server understood the request, but is refusing to fulfill it."
>
> > What could be causing this error and how can I fix it?
>
> --
> Abraham Williams |http://the.hackerconundrum.com
> Web608 | Community Evangelist |http://web608.org
> This email is: [ ] blogable [x] ask first [ ] private.
> Sent from: Madison Wisconsin United States.

Reply via email to