XML Format
If XML is preferred, set the standard http header Accept
to the value text/xml
and the Slingshot API server will send all non-binary responses to the client in XML format.
The example below demonstrates how to set the appropriate header in code.
C#
HttpWebRequest httpWebRequest;
httpWebRequest =
WebRequest.Create(new Uri("https://api.ravenslingshot.com/FieldHubs"))
as HttpWebRequest;
httpWebRequest.Accept = "text/xml";
httpWebRequest.Method = WebRequestMethods.Http.Get;
Examples
SlingshotIndex
Example of a simple SlingshotIndex in XML:
<!--?xml version="1.0" encoding="utf-8"?-->
<slingshotindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.ravenslingshot.com/SlingshotIndex/2010">
<totalcount>141</totalcount>
<pagesize>2</pagesize>
<ispreviouspage>false</ispreviouspage>
<isnextpage>true</isnextpage>
<pageindex>0</pageindex>
<totalpages>71</totalpages>
<fieldhub>
<id>12345678901</id>
<name>Field Hub 1</name>
<uri>https://api.ravenslingshot.com/FieldHubs/12345678901</uri>
</fieldhub>
<fieldhub>
<id>12345678902</id>
<name>Field Hub 2</name>
<uri>https://api.ravenslingshot.com/FieldHubs/12345678902</uri>
</fieldhub>
</slingshotindex>
SlingshotResponse
Example of a SlingshotResponse in XML:
<!--?xml version="1.0" encoding="utf-8"?-->
<slingshotresponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.ravenslingshot.com/SlingshotResponse/2010">
<status>INVALID_REQUEST</status>
<errorinfo>Item does not exist</errorinfo>
<result xsi:nil="true">
</result>
</slingshotresponse>