Asmita, You might want to look at the following Python sample for how to generate the signature: https://github.com/kdamage/IndividualCode/blob/master/CloudStack%20API%20Signing%20Class/SignedAPICall.py
I noticed in your openssl command, you only used the "keypair=..." part of the query string. I think you need to include the entire query string, such as "command=listAccounts&keypair=...". - Chris On Tue, Jan 15, 2013 at 7:21 AM, James Osbourn <james.osbo...@citrix.com>wrote: > I had problems generating API calls and generated a script to assist me > which I have attached to my response. This is a perl script which takes a > number of argument and either returns the API call string or makes the call > for you. You should be able to use this as a basis for anything else you > wish to achieve. > > James > > > -----Original Message----- > > From: Asmita Vagyani [mailto:asmita.vagy...@sigma-systems.com] > > Sent: 15 January 2013 11:25 > > To: 'cloudstack-users@incubator.apache.org' > > Subject: RE: Cloudstack API calls > > > > Thnx Prasanna, James, > > > > Using the url provided by James, I could invoke the API. > > > > ]# curl --user "admin:sigma123" > > "http://localhost:8080/client/api?command=listAccounts&keypair=bXFnKCix > > 8VhhEGunkFbo0- > > PGixkjOhtb2gKA\&signature=eaddca273cba89aacf4d0472356516586e2b24f8" > > Response: > > > > <?xml version="1.0" encoding="UTF-8"?><listaccountsresponse cloud-stack- > > version="4.0.0.20121024012150"><errorcode>401</errorcode><errortext>u > > nable to verify user credentials and/or request > > signature</errortext></listaccountsresponse> > > > > The credentials were not correct. > > How do you create the api key and the signature, I dint quite > understand the > > documentation for this, please guide. > > > > @Prasanna : We cannot use cloudmonkey interface because we don't > > manually call the APIs. We have our own provisioning system, which makes > a > > call to the REST APIs that the Cloudstack provides. > > > > Thanks and Regards. > > > > Asmita Patil Vagyani. > > > > > > -----Original Message----- > > From: prasanna [mailto:srivatsav.prasa...@gmail.com] On Behalf Of > > Prasanna Santhanam > > Sent: 15 January 2013 PM 04:33 > > To: cloudstack-users@incubator.apache.org > > Subject: Re: Cloudstack API calls > > > > On Tue, Jan 15, 2013 at 04:30:05PM +0530, Asmita Vagyani wrote: > > > Hi all, > > > > > > After installing management server I am trying to call a cloudstack > > > API - > > > > > > #curl --user "admin:sigma123" > > > > > "http://localhost:8080/client/api?command=listAccountskeypair=bXFnKCix8 > > VhhEGunkFbz8gWgwHc3WB0Tg7m3nE7LujhYo0- > > PGixkjOhtb2gKA\&signature=eaddca273cba89aacf4d0472356516586e2b24f8" > > > > > > <?xml version="1.0" encoding="UTF-8"?><errorresponse > > > cloud-stack- > > version="4.0.0.20121024012150"><errorcode>432</errorcode>< > > > errortext>The given command does not > > > exist</errortext></errorresponse>[root@torvm-cloudstack-mgmt ~]# > > > > > > I am getting an error saying command doesnot exist. > > > > > > I generated the signature using > > > # echo -n "value" | openssl sha1 -hmac > > > > > "keypair=bXFnKCix8VhhEGunkFbzqniHwYjgVUFr7KrUbKIc_g_tH8gWgwHc3W > > B0Tg7m3nE7LujhYo0-PGixkjOhtb2gKA" > > > > > Try cloudmonkey: > > https://cwiki.apache.org/confluence/display/CLOUDSTACK/CloudStack+clou > > dmonkey+CLI > > > > It encapsulates what you are trying to do through an autcompleteing CLI. > > > > > > -- > > Prasanna., > > > >