You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@esme.apache.org by Uday Subbarayan <ud...@yahoo.com> on 2010/02/23 16:16:10 UTC

curl API example

How do I POST a message via API using curl for my account in my local environment?

Thanks,
Uday.



      

Re: curl API example (reformat)

Posted by Richard Hirsch <hi...@gmail.com>.
Thanks

I added it to the wiki:
http://cwiki.apache.org/confluence/display/ESME/FAQ#FAQ-curl1

D.

On Wed, Feb 24, 2010 at 4:25 PM, Uday Subbarayan
<ud...@yahoo.com> wrote:
> I am resending the same content with Firefox as Chrome messed up with formatting.
>
> Thanks. I got it working.
>
> Here is the steps. (may be this information can be published in the website for others)
>
> Step-0: Generate Token:
> Login to ESME via WebGui and used the Tokens menu at the top to create a new token.
>
> Step-1:Construct the curl command:
> Here is my example-
>
> curl -X POST -v -u [your user id]:[your token from step-0] -d status="my curl message on feb 24"http://localhost:8080/esme/twitter/statuses/update.xml
>
> My ESME has 'esme' context running in Jetty. I didn't make any config change and is the default deployment. My WebGUI login is,http://localhost:8080/esme/
>
> Step-2: Execute curl command:
> Make sure you have curl installed on your system. My system is Ubuntu. Cut n paste the curl command in the terminal and hit enter. (For convenience you can keep your WebGui running to check the message).
>
> After you hit enter, you should get 200 ok status from the server and a XML response. You can check the new message in the WebGUI and it updates REAL TIME! ( no refresh needed)
>
> Run multiple times curl to see the updates in WebGui. I used Firefox.
>
> Best,
> -Uday.
>
> --- On Wed, 2/24/10, Uday Subbarayan <ud...@yahoo.com> wrote:
>
> From: Uday Subbarayan <ud...@yahoo.com>
> Subject: Re: curl API example
> To: esme-dev@incubator.apache.org
> Date: Wednesday, February 24, 2010, 3:20 PM
>
> Thanks. I got it working. Here is the steps. (may be this information can be published in the website for others)
> Step-0: Generate TokenLogin to ESME via WebGui and used the Tokens menu at the top to create a new token.
> Step-1:Construct the curl commandHere is my example-
>
> curl -X POST -v -u [your user id]:[your token from step-0] -d status="my curl message on feb 24" http://localhost:8080/esme/twitter/statuses/update.xml
> My ESME has 'esme' context running in Jetty. I didn't make any config change and is the default deployment. My WebGUI login is,http://localhost:8080/esme/
> Step-2: Execute curl commandMake sure you have curl installed on your system. My system is Ubuntu. Cut n paste the curl command in the terminal and hit enter. (For convenience you can keep your WebGui running to check the message).
> After you hit enter, you should get 200 ok status from the server and a XML response. You can check the new message in the WebGUI and it updates REAL TIME! ( no refresh needed)
> Run multiple times curl to see the updates in WebGui. I used Firefox.
> Best,-Uday.
> --- On Tue, 2/23/10, Richard Hirsch <hi...@gmail.com> wrote:
>
> From: Richard Hirsch <hi...@gmail.com>
> Subject: Re: curl API example
> To: esme-dev@incubator.apache.org
> Date: Tuesday, February 23, 2010, 3:36 PM
>
> http://[USER]:[TOKEN]@localhost:80/twitter/statuses/update.xml
> status=[MESSAGE]
>
> Via HTTP POST
>
> On Tue, Feb 23, 2010 at 4:16 PM, Uday Subbarayan
> <ud...@yahoo.com> wrote:
>> How do I POST a message via API using curl for my account in my local environment?
>>
>> Thanks,
>> Uday.
>>
>>
>>
>>
>
>
>
>
>
>
>

Re: curl API example (reformat)

Posted by Uday Subbarayan <ud...@yahoo.com>.
I am resending the same content with Firefox as Chrome messed up with formatting.

Thanks. I got it working. 

Here is the steps. (may be this information can be published in the website for others)

Step-0: Generate Token:
Login to ESME via WebGui and used the Tokens menu at the top to create a new token.

Step-1:Construct the curl command:
Here is my example-

curl -X POST -v -u [your user id]:[your token from step-0] -d status="my curl message on feb 24"http://localhost:8080/esme/twitter/statuses/update.xml

My ESME has 'esme' context running in Jetty. I didn't make any config change and is the default deployment. My WebGUI login is,http://localhost:8080/esme/

Step-2: Execute curl command:
Make sure you have curl installed on your system. My system is Ubuntu. Cut n paste the curl command in the terminal and hit enter. (For convenience you can keep your WebGui running to check the message).

After you hit enter, you should get 200 ok status from the server and a XML response. You can check the new message in the WebGUI and it updates REAL TIME! ( no refresh needed)

Run multiple times curl to see the updates in WebGui. I used Firefox.

Best,
-Uday.

--- On Wed, 2/24/10, Uday Subbarayan <ud...@yahoo.com> wrote:

From: Uday Subbarayan <ud...@yahoo.com>
Subject: Re: curl API example
To: esme-dev@incubator.apache.org
Date: Wednesday, February 24, 2010, 3:20 PM

Thanks. I got it working. Here is the steps. (may be this information can be published in the website for others)
Step-0: Generate TokenLogin to ESME via WebGui and used the Tokens menu at the top to create a new token.
Step-1:Construct the curl commandHere is my example-

curl -X POST -v -u [your user id]:[your token from step-0] -d status="my curl message on feb 24" http://localhost:8080/esme/twitter/statuses/update.xml
My ESME has 'esme' context running in Jetty. I didn't make any config change and is the default deployment. My WebGUI login is,http://localhost:8080/esme/
Step-2: Execute curl commandMake sure you have curl installed on your system. My system is Ubuntu. Cut n paste the curl command in the terminal and hit enter. (For convenience you can keep your WebGui running to check the message).
After you hit enter, you should get 200 ok status from the server and a XML response. You can check the new message in the WebGUI and it updates REAL TIME! ( no refresh needed)
Run multiple times curl to see the updates in WebGui. I used Firefox.
Best,-Uday.
--- On Tue, 2/23/10, Richard Hirsch <hi...@gmail.com> wrote:

From: Richard Hirsch <hi...@gmail.com>
Subject: Re: curl API example
To: esme-dev@incubator.apache.org
Date: Tuesday, February 23, 2010, 3:36 PM

http://[USER]:[TOKEN]@localhost:80/twitter/statuses/update.xml
status=[MESSAGE]

Via HTTP POST

On Tue, Feb 23, 2010 at 4:16 PM, Uday Subbarayan
<ud...@yahoo.com> wrote:
> How do I POST a message via API using curl for my account in my local environment?
>
> Thanks,
> Uday.
>
>
>
>



      


      

Re: curl API example

Posted by Uday Subbarayan <ud...@yahoo.com>.
Thanks. I got it working. Here is the steps. (may be this information can be published in the website for others)
Step-0: Generate TokenLogin to ESME via WebGui and used the Tokens menu at the top to create a new token.
Step-1:Construct the curl commandHere is my example-

curl -X POST -v -u [your user id]:[your token from step-0] -d status="my curl message on feb 24" http://localhost:8080/esme/twitter/statuses/update.xml
My ESME has 'esme' context running in Jetty. I didn't make any config change and is the default deployment. My WebGUI login is,http://localhost:8080/esme/
Step-2: Execute curl commandMake sure you have curl installed on your system. My system is Ubuntu. Cut n paste the curl command in the terminal and hit enter. (For convenience you can keep your WebGui running to check the message).
After you hit enter, you should get 200 ok status from the server and a XML response. You can check the new message in the WebGUI and it updates REAL TIME! ( no refresh needed)
Run multiple times curl to see the updates in WebGui. I used Firefox.
Best,-Uday.
--- On Tue, 2/23/10, Richard Hirsch <hi...@gmail.com> wrote:

From: Richard Hirsch <hi...@gmail.com>
Subject: Re: curl API example
To: esme-dev@incubator.apache.org
Date: Tuesday, February 23, 2010, 3:36 PM

http://[USER]:[TOKEN]@localhost:80/twitter/statuses/update.xml
status=[MESSAGE]

Via HTTP POST

On Tue, Feb 23, 2010 at 4:16 PM, Uday Subbarayan
<ud...@yahoo.com> wrote:
> How do I POST a message via API using curl for my account in my local environment?
>
> Thanks,
> Uday.
>
>
>
>



      

Re: curl API example

Posted by Richard Hirsch <hi...@gmail.com>.
http://[USER]:[TOKEN]@localhost:80/twitter/statuses/update.xml
status=[MESSAGE]

Via HTTP POST

On Tue, Feb 23, 2010 at 4:16 PM, Uday Subbarayan
<ud...@yahoo.com> wrote:
> How do I POST a message via API using curl for my account in my local environment?
>
> Thanks,
> Uday.
>
>
>
>