Knowledge Base Article

> Knowledge Base > Spira Platform

by  inflectra.simon Wednesday, March 22, 2017

SpiraTeam lets you send data for POST requests in our REST API using either JSON or XML. To ensure that data is saved correctly, when using XML all fields must be in alphabetical order.

If you try to send XML as below, only the first field will be correctly interpreted by the XML parser used in SpiraTeam

<RemoteTestCase xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v5_0.DataObjects">
  <TestCaseStatusId>6</TestCaseStatusId>
  <Description>Description of the new test case</Description>
  <OwnerId>45</OwnerId>
  <Name>The best test case ever</Name>
</RemoteTestCase>

 

To make sure that all 4 fields will be received correctly by SpiraTeam, so that the API call will be successful, you need to send the XML with all tags in alphabetical order - as below.

<RemoteTestCase xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v5_0.DataObjects">
  <Description>Description of the new test case</Description>
  <Name>The best test case ever</Name>
  <OwnerId>45</OwnerId>
  <TestCaseStatusId>6</TestCaseStatusId>
</RemoteTestCase>

 

If using JSON, the field order is not important.

Article Info
  • Last Updated: 3/22/2017
  • Article ID: KB246
  • Views: 418