Skip to main content

JSON Format

If JSON is preferred, set the standard http header Accept to the value application/json and the Slingshot API server will send all non-binary responses to the client in JSON format.

The example below shows how to can set the Accept header in code.

C#

HttpWebRequest httpWebRequest;
httpWebRequest =
WebRequest.Create(new Uri("https://api.ravenslingshot.com/FieldHubs"))
as HttpWebRequest;
httpWebRequest.Accept = "application/json";
httpWebRequest.Method = WebRequestMethods.Http.Get;

Examples

SlingshotIndex

Example of a simple SlingshotIndex in JSON:

{
"FieldHub": [
{
"ID": "12345678901",
"Name": "Field Hub 1",
"Uri": "https://api.ravenslingshot.com/FieldHubs/12345678901"
},
{
"ID": "12345678902",
"Name": "Field Hub 2",
"Uri": "https://api.ravenslingshot.com/FieldHubs/12345678902"
}
],
"TotalCount": 141,
"PageSize": 2,
"IsPreviousPage": false,
"IsNextPage": true,
"PageIndex": 0,
"TotalPages": 72
}

SlingshotResponse

Example of a SlingshotResponse in JSON:

{
"status": "INVALID_REQUEST",
"errorInfo": "Item does not exist"
}