Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

vRA Service API Data serialization error when trying to create a Property Definition

$
0
0

This is my first time trying to create any vRA content using the REST API. I've successfully exported my blueprint, form, property group and property definitions using the API.  But when I try to create a new one using the exported JSON I get the following error:

 

 

{"errors":[{"code":10104,"source":null,"message":"Data serialization error.","systemMessage":"Could not read message [acceptableTypes: [application/*+json,
application/json]]","moreInfoUrl":null}]}

 

 

Thinking there might be something wrong with my JSON I tried using the sample JSON in the "Try It" section of the API Docs and get the same issue.  Before I open a case I thought I would see if anyone has run into this before.  Search results in Google come up with a couple hits that are not related to using the API.

 

 

I am using PowerShell and here is what I think are the relavent snippets:

 

 

    $json = get-content C:\DATA\vRA_Exports\MyBluePrint\propertyDefinitions\IASTest.json

 

    $headers = @{“Content-Type” = “application/json”; “Accept” = “application/json”; “Authorization” = “Bearer $token”}
    $uri = "https://$vraHost/properties-service/api/propertydefinitions/IASTest"

 

    $response = Invoke-RestMethod -Method Put -Uri $uri -Headers $headers -Body $json

 

 

And here is the JSON I'm testing with from the "Try It" API docs:

 

 

{
  "id": "IASTest",
  "label": "My Label",
  "description": "Testing Rest API",
  "dataType": {
    "type": "primitive",
    "typeId": "STRING"
  },
  "isMultiValued": false,
  "permissibleValues": {
    "customAllowed": false
  },
  "displayAdvice": "TEXTBOX",
  "orderIndex": 0,
  "tenantId": "test"
  "version": 1,
}

 

{"errors":[{"code":10104,"source":null,"message":"Data serialization error.","systemMessage":"Could not read message [acceptableTypes: [application/*+json,

 

application/json]]","moreInfoUrl":null}]}

Viewing all articles
Browse latest Browse all 175326

Trending Articles



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