Quantcast
Channel: VMware Communities : All Content - vRealize Automation Tools
Viewing all articles
Browse latest Browse all 9859

vRA 6.1 API problem with POST /catalog-service/api/consumer/requests

$
0
0

Hi, I'm using vCloud Automation Center 6.1 and I'd like to use its REST API from a java client that I'm writing. Some of the API methods are working as expected but for

 

REQUEST

 

>> "{"@type":"CatalogItemRequest","catalogItemRef":{"id":"752ae9bd-abcd-4dc4-b425-6f5e3c8620b0"},"organization":{"tenantRef":"MY_TENANT","subtenantRef":"BUSINESS_GROUP_ID"},"requestedFor":"MY_USER","state":"SUBMITTED","requestNumber":0,"requestData":{"entries":[{"key":"provider-blueprintId","value":{"type":"string","value":"e32edcf1-6a10-4bc7-98e2-a23245aeb857"}}]}}"

>> POST https://VRA_URL/catalog-service/api/consumer/requests HTTP/1.1

>> Accept: application/json >> Authorization: Bearer MTQyNzg4NjEyNTg3N...mM0MTQ=

>> Content-Type: application/json >> Content-Length: 355

 

RESPONSE

 

<< HTTP/1.1 400 Bad Request

<< Vary: Accept-Encoding,User-Agent

<< Date: Wed, 01 Apr 2015 11:02:16 GMT

<< Connection: close

<< Pragma: no-cache

<< Cache-Control: no-cache, no-store

<< Content-Type: application/json;charset=UTF-8

<< Content-Length: 745 << Expires: Thu Jan 01 00:59:59 CET 1970

<< "{"errors":[{"code":10104,"message":"Data serialization error.","systemMessage":"Could not read JSON: Unable to unmarshal (to type [simple type, class com.vmware.vcac.catalog.domain.rest.OrganizationReference]): Invalid argument. (through reference chain: com.vmware.vcac.catalog.domain.request.CatalogItemRequest[\"organization\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Unable to unmarshal (to type [simple type, class com.vmware.vcac.catalog.domain.rest.OrganizationReference]): Invalid argument. (through reference chain: com.vmware.vcac.catalog.domain.request.CatalogItemRequest[\"organization\"]) [acceptableTypes: [application/*+json;charset=UTF-8, application/json;charset=UTF-8]]","moreInfoUrl":null}]}"

 

It seems like the json string that I'm posting is not valid because of "organization" field. But both the official doc http://pubs.vmware.com/vCAC-61/topic/com.vmware.ICbase/PDF/vcloud-automation-center-61-programming-guide.pdf and/or this blog post http://www.vmtocloud.com/vrealize-automation-rest-api-with-curl/ contain a similar json request.

 

Any ideas?

 

Thanks,

Andrea


Viewing all articles
Browse latest Browse all 9859

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>