You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Dean Kamali <de...@gmail.com> on 2014/08/30 21:22:18 UTC

API Response Formats: XML and JSON

Hey everyone,

According to docs, CloudStack supports two formats as the response to
an API call. The default response is XML. If you would like the
response to be in JSON, add &response=json to the Command String.

I'm using CS 4.4 and when making an API call, I get response in XML
which is okay, however everytime I attempt to add &response=json to an
API call, I get error 401.
{

-
listvirtualmachinesresponse: {

uuidList: [ ]
errorcode: 401
errortext: "unable to verify user credentials and/or request signature"

}

Any idea on what is wrong?

Re: API Response Formats: XML and JSON

Posted by ilya musayev <il...@gmail.com>.
You can also try running cloudmonkey and "set display json" - this way 
it prints all the output in json format.

Regards
ilya
On 8/30/14, 12:39 PM, Erik Weber wrote:
> On Sat, Aug 30, 2014 at 9:22 PM, Dean Kamali <de...@gmail.com> wrote:
>
>> Hey everyone,
>>
>> According to docs, CloudStack supports two formats as the response to
>> an API call. The default response is XML. If you would like the
>> response to be in JSON, add &response=json to the Command String.
>>
>> I'm using CS 4.4 and when making an API call, I get response in XML
>> which is okay, however everytime I attempt to add &response=json to an
>> API call, I get error 401.
>> {
>>
>> -
>> listvirtualmachinesresponse: {
>>
>> uuidList: [ ]
>> errorcode: 401
>> errortext: "unable to verify user credentials and/or request signature"
>>
>> }
>>
>>
> Did you recalculate the signature?
>


Re: API Response Formats: XML and JSON

Posted by Erik Weber <te...@gmail.com>.
On Sat, Aug 30, 2014 at 9:22 PM, Dean Kamali <de...@gmail.com> wrote:

> Hey everyone,
>
> According to docs, CloudStack supports two formats as the response to
> an API call. The default response is XML. If you would like the
> response to be in JSON, add &response=json to the Command String.
>
> I'm using CS 4.4 and when making an API call, I get response in XML
> which is okay, however everytime I attempt to add &response=json to an
> API call, I get error 401.
> {
>
> -
> listvirtualmachinesresponse: {
>
> uuidList: [ ]
> errorcode: 401
> errortext: "unable to verify user credentials and/or request signature"
>
> }
>
>

Did you recalculate the signature?

-- 
Erik