An API Key is issued by Raven to qualified ISV partners that intend on developing solutions using Slingshot data. A corresponding Shared Secret is issued at the same time. The API Key and the Shared Secret are a matched set and uniquely identify the ISV to Raven Industries, Inc. The API Key and Shared Secret are available only after a completed and signed ISV agreement has been executed.
A Shared Secret is known only to the ISV and Raven. It is the ISV's responsibility to protect the Shared Secret.
Raven issues an Access Key to Slingshot customers via the Slingshot Portal. A Slingshot portal account is required before an ISV customer can request an Access Key. Slingshot customers must be careful in allowing a third party to have an Access Key to their information. An Access Key allows a third party user (i.e., an ISV partner) to access all of a customer’s Slingshot data, including personal information protected under various jurisdictions’ privacy laws. The third party can see the Slingshot customer’s name, geographic location, details added about the machine(s), agronomic data, and any other data a Slingshot customer inputs into Slingshot or allows a machine using Slingshot to capture. A Slingshot customer may revoke an Access Key grant at any time, and revoking an Access Key grant will revoke that third party’s right to access the customer’s data on Slingshot.
All requests to the Slingshot API Server will contain the following custom HTTP headers:
X-SS-APIKey | The API Key issued to the Slingshot developer from Raven. |
X-SS-Signature | The signature generated for this request using the Shared Secret issued by Raven to the ISV. |
X-SS-AccessKey | The Access Key issued to a Slingshot user from the Raven Slingshot Portal Server. |
X-SS-TimeStamp | The Unix-Style timestamp of when the request was generated; the number of seconds elapsed from midnight on Jan 1, 1970. |
These header values, along with other key components of the request will be used to provide a signature that will verify the request. Details for generating this signature can be found later in this document.
All requests to the Slingshot API Server will be authenticated in 3 ways:
If any of these checks fail, the Slingshot API server will respond with a 401 Unauthorized response. Details of what check failed may be returned in the body of the response.
After a request is authenticated, an authorization check will be performed using the Access Key that is part of the request. This Access Key will be used to control how much data will be returned to the client based on the account delegation configuration on the Slingshot Portal Server. An additional authorization check will be performed at the URI level to ensure that only the allowed HTTP verbs for each URI are being sent. Failed authorization attempts will result in one of the following responses:
In order to prevent abuse, all calls to the API are subject to a rate limit of 30 calls per every 60 seconds.
When a client has exceeded the number of API calls available during a rate limit window, all future requests will return a HTTP 429 status code.
All requests that are subject to rate limiting include the following headers that provide information about the current rate limit and the rate-limit window.
X-RateLimit-Limit | The total number of requests that can be made during a rate-limit period. |
X-RateLimit-Remaining | The number of requests that may still be made before the rate limit is reset. |
X-RateLimit-Reset | The number of seconds before the rate limit is reset. |
The most difficult part of building a proper request to the API is building the signature and signing it with a shared secret. In any language, a properly signed signature for the request should be generated using the following steps:
Method | HTTP Method in ALL CAPS (e.g. GET, PUT, POST, DELETE, HEAD, OPTIONS). |
Host | Host name of server in lower case (e.g. api.ravenslingshot.com). |
URL | Absolute URI minus query string in lower case (e.g. /fieldcomputers/460/PrescriptionMaps). |
Unix Timestamp | Unix style timestamp of the request (number of seconds since midnight on Jan 1 1970). |
API Key | Slingshot API Key in the case in which it was generated. |
Access Key | Slingshot Access Key in the case in which it was generated. |
A function for building the signature is shown in various languages below. You can test your implementation by making sure the function produces an output of EssUFos9uCpS1FFUFaPTE3Qucz0= when provided the following strings (all encoded as UTF8):
Method | GET |
Host | host.company.com |
URL | /absolute/path |
Unix Timestamp | 1234567890 |
API Key | 071X7Hc9zdfElbB2fUqQVjAQ3BsOPa4F9l3yqekl |
Access Key | 00000000-0000-0000-0000-000000000000 |
Shared Secret | RecQ1RrXLNP/WnMqrJsj5WsuXNDmCOoCg3AV85DQ |
private static string CalculateSignature(string sharedSecret, string method, string url, string host, string apiKey, string accessKey, string timestamp) { string signatureBlockTemplate = "{0}\r\n{1}\r\n{2}\r\n{3}\r\n{4}\r\n{5}\r\n"; string blockToSign = String.Format(signatureBlockTemplate, method.ToUpperInvariant(), host.ToLowerInvariant(), url.ToLowerInvariant(), timestamp, apiKey, accessKey); using (HMACSHA1 hmacsha1 = new HMACSHA1()) { Encoding encoder = new UTF8Encoding(); hmacsha1.Key = Convert.FromBase64String(sharedSecret); byte[] hmacsig = hmacsha1.ComputeHash(encoder.GetBytes(blockToSign)); return Convert.ToBase64String(hmacsig); } }
private String CalculateSignature(String sharedSecret, String method, String url, String host, String apiKey, String accessKey, String timestamp) throws java.security.SignatureException { private String signatureBlockTemplate = "%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n"; String blockToSign = String.format(signatureBlockTemplate, method.toUpperCase(Locale.US), host.toLowerCase(Locale.US), url.toLowerCase(Locale.US), timestamp, apiKey, accessKey); String result; try { // get an hmac_sha1 key from the raw key bytes SecretKeySpec signingKey = new SecretKeySpec(com.ss.sscompanion.utilities.Base64.decode(sharedSecret), HMAC_SHA1_ALGORITHM); // get an hmac_sha1 Mac instance and initialize with the signing key Mac mac = Mac.getInstance(HMAC_SHA1_ALGORITHM); mac.init(signingKey); // compute the hmac on input data bytes byte[] rawHmac = mac.doFinal(blockToSign.getBytes()); // base64-encode the hmac result = com.ss.sscompanion.utilites.Base64.encodeBytes(rawHmac); } catch (Exception e) { throw new SignatureException("Failed to generate HMAC : " + e.getMessage()); } return result; }
private function calculateSignature($sharedSecret, $method, $url, $host, $apiKey, $accessKey, $timestamp) { $signatureBlock = sprintf("%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n", strtoupper($method), $host, strtolower($url), $timestamp, $apiKey, $accessKey); return base64_encode(hash_hmac('sha1', $signatureBlock, base64_decode($sharedSecret, true), true)); }
Result set paging is supported for some API calls. The number of results returned and the relative starting offset of the result set is controlled by the following parameters:
pageSize | The number of records to return in this request. If omitted, the default value is 20. We deprecated setting a pageSize of 0 to return a complete and un-paged result set. We recommend a maximum page size of no more than 1000 to improve performance |
page | The index of the result page to return. If omitted, the default value is 0. |
TotalCount | The total number of records in the list being returned. |
PageSize | The number of records returned in this request. This is controlled by the optional query string parameter "pageSize". |
IsPreviousPage | A boolean value indicating if there are any pages prior to the current page in this list. |
IsNextPage | A boolean value indicating if there are any pages after the current page in this list. |
PageIndex | The index of the current page. The page index is zero based and has a maximum value of ([TotalPages] - 1). This is controlled by the optional query string parameter "page". |
TotalPages | The total number of pages in this list given the [TotalCount] and [PageSize]. |
There are several notable differences between the current version of the Slingshot API and prior releases:
The Slingshot API server has three major response types: SlingshotIndex, SlingshotResponse, and Binary Data.
The SlingshotIndex response is used to return any list of items. The header of the XML is included below:
4 20 false false 0 1
The rest of the SlingshotIndex response consists of summary items of the type being asked for (Field Computers, Prescription Maps, or Job Data). These entries are represented by the following XML fragment:
1449 Job from Field https://api.ravenslingshot.com/{nameofitem}/1449 Subordinate type of object
The Slingshot API server has three major response types: SlingshotIndex, SlingshotResponse, and Binary Data.
The SlingshotResponse response is used in two situations:
The SlingshotResponse response is represented by the following XML:
INVALID_REQUEST Could not send file to Field Computer
When an API client requests files from the Slingshot API Server, the server will respond with the binary data of the file in the response body. The server will also indicate the suggested file name via the standard HTTP header Content-Disposition. The server will indicate the type of binary data via the standard HTTP header Content-Type.
An error response where the server returns a 503 HTTP response indicating database issues.
The response will be a string "Resources exhausted. Try again.".
This means there is some database issue and the user needs to wait for some time before making further requests.
If you prefer XML, you can set the standard http header Accept to the value 'text/xml' and the Slingshot API server will send all non-binary respones to your client in XML format. Example below shows how you can set the Accept header in your code.
HttpWebRequest httpWebRequest; httpWebRequest = WebRequest.Create( new Uri("https://api.ravenslingshot.com/FieldHubs") as HttpWebRequest; httpWebRequest.Accept = "text/xml"; httpWebRequest.Method = WebRequestMethods.Http.Get;
Example of a simple SlingshotIndex in XML
141 2 false true 0 71 12345678901 Field Hub 1 https://api.ravenslingshot.com/FieldHubs/12345678901 12345678902 Field Hub 2 https://api.ravenslingshot.com/FieldHubs/12345678902
Example of a Slingshot Response in XML
INVALID_REQUEST Item does not exist
If you prefer JSON, you can set the standard http header Accept to the value 'application/json' and the Slingshot API server will send all non-binary respones to your client inJSON format. Example below shows how you can set the Accept header in your code.
HttpWebRequest httpWebRequest; httpWebRequest = WebRequest.Create( new Uri("https://api.ravenslingshot.com/FieldHubs") as HttpWebRequest; httpWebRequest.Accept = "application/json"; httpWebRequest.Method = WebRequestMethods.Http.Get;
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 }
Example of a Slingshot Response in JSON
{ "status" : "INVALID_REQUEST", "errorInfo" : "Item does not exist" }
The Slingshot API supports the compression of JSON / XML responses. If you would like to use compression, set the standard http header 'Accept-Encoding' to either 'gzip' or 'deflate' and the Slingshot API server will compress the data before sending it to your client.
The following code sample shows how to set the 'Accept-Encoding' header to ask the Slingshot API for compressed responses.
HttpWebRequest httpWebRequest; httpWebRequest = HttpWebRequest.Create("https://api.ravenslingshot.com/FieldHubs") as HttpWebRequest; httpWebRequest.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip");
The following code sample shows how to check for a compressed response and decompress it.
//This sample merely dumps the response to the console. //Chage the Decompress.CopyTo target to your preferred stream string contentEncoding = resp.Headers["Content-Encoding"]; if (String.IsNullOrEmpty(contentEncoding)) { Console.WriteLine(resp.Content.ReadAsString()); } else { if (contentEncoding.ToUpperInvariant().Contains("GZIP")) { using (GZipStream Decompress = new GZipStream(resp.Content.ReadAsStream(), CompressionMode.Decompress)) { // Copy the decompression stream // into the output file. Decompress.CopyTo(Console.OpenStandardOutput()); } Console.WriteLine(); } else if (contentEncoding.ToUpperInvariant().Contains("DEFLATE")) { using (DeflateStream Decompress = new DeflateStream(resp.Content.ReadAsStream(), CompressionMode.Decompress)) { // Copy the decompression stream // into the output file. Decompress.CopyTo(Console.OpenStandardOutput()); } Console.WriteLine(); } else { Console.WriteLine("compression method {0} not supported", contentEncoding); } }
$curl = curl_init();//initialize curl curl_setopt($curl, CURLOPT_URL, "https://api.ravenslingshot.com/FieldHubs"); curl_setopt($curl, CURLOPT_HEADER, false);//false - truncates the header from the response (if you want header set it to true) curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); //prepare header $header = array(); array_push($header, 'X-SS-APIKey: '. 'yourApiKey'); array_push($header, 'X-SS-AccessKey: '. 'yourAccessKey'); array_push($header, 'X-SS-TimeStamp: '. 'yourTimestamp'); array_push($header, 'X-SS-Signature: '.'yourSignature'); //request for compressed reponse array_push($header, 'Accept-Encoding: gzip'); curl_setopt($curl, CURLOPT_HTTPHEADER, $header); //make the call $curl_response = curl_exec($curl); //uncompress the data $uncompressed = gzdecode($curl_response); //pretty print echo "".htmlentities($uncompressed).""; //close curl connection curl_close($curl);
Field name | Data type | Unit\Format | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Device File Name | nvarchar(100) | The name of the job file as it was saved on the field computer | |||||||||||||||||
Create Date | Datetime | UTC - YYYY-MM-DDTHH:MM:SSZ | The date / time (in UTC) of when the file was uploaded to slingshot | ||||||||||||||||
Update Date | Datetime | UTC - YYYY-MM-DDTHH:MM:SSZ | The date / time in UTC) of the most recent update the slingshot system made to this file | ||||||||||||||||
Status | String | NA | The state of the file in the slingshot system.
|
||||||||||||||||
Job Type | nvarchar(50) | NA | One of Yield, AsApplied, or Planter | ||||||||||||||||
Available Files | String | NA | List of URLs that can be used to download more information about this job (shape files, rad file) | ||||||||||||||||
ID | int | NA | Internal record id of this job data | ||||||||||||||||
File Name | nvarchar(100 | NA | The base file name for this job (Planter and Yield) | ||||||||||||||||
Job Name | nvarchar(100 | NA | The base file name for this job (Sprayer) | ||||||||||||||||
Start Date | Datetime | UTC - YYYY-MM-DDTHH:MM:SS | The date / time of when the job was started on the field computer (only as accurate as the field computer date / time settings) | ||||||||||||||||
End Date | Datetime | UTC - YYYY-MM-DDTHH:MM:SS | The date / time of when the job was ended on the field computer (only as accurate as the field computer date / time settings) | ||||||||||||||||
Software Version | nvarchar(50) | NA | Should be set to the version string of the field computer, but is often empty |
Field name | Data type | Unit\Format | Description |
---|---|---|---|
Customer Name | nvarchar(50) | NA | Free form text value on field computer |
Customer Address | nvarchar(100) | NA | Free form text value on field computer |
Customer Number | nvarchar(50) | NA | Free form text value on field computer |
Operator Name | nvarchar(50) | NA | Free form text value on field computer |
Operator Address | nvarchar(50) | NA | Free form text value on field computer |
Operator License | nvarchar(50) | NA | Free form text value on field computer |
Field Name | nvarchar(50) | NA | Free form text value on field computer |
Field Section | nvarchar(50) | NA | Free form text value on field computer |
Field County | nvarchar(50) | NA | Free form text value on field computer |
Field Township | nvarchar(50) | NA | Free form text value on field computer |
Field Crop | nvarchar(50) | NA | Free form text value on field computer |
Field Area | nvarchar(50) | NA | Free form text value on field computer |
Application Type | nvarchar(50) | NA | Free form text value on field computer |
Soil Condition | nvarchar(50) | NA | Free form text value on field computer |
Moisture | nvarchar(50) | NA | Free form text value on field computer |
Tip Size | nvarchar(50) | NA | Free form text value on field computer |
Average Speed | nvarchar(50) | meter per second | The average speed of the job in m/s |
Weather Observation Time | nvarchar(50) | NA | Free form text value on field computer |
Weather Temperature | nvarchar(50) | NA | Free form text value on field computer |
Weather Wind Speed | nvarchar(50) | NA | Free form text value on field computer |
Weather Humidity | nvarchar(50) | NA | Free form text value on field computer |
Weather Wind Direction | nvarchar(50) | NA | Free form text value on field computer |
List of products for this job.Each product has the following fields. |
|||
ID | int | NA | Internal id of the product in slingshot |
Product Number | int | NA | The sequential id of the products in this job (0 based) |
Product Name | nvarchar(50) | NA | The name of the product as the operator entered it |
Applied Volume | float | NA | The total volume of the product applied (units come from how the field computer is configured) |
Applied Area | float | square meter | The total area that this product was applied |
Target Rat | float | NA | The target rate for this product (units come from how the field computer is configured) |
Target Rate Min | float | NA | The minimum rate this product was applied (units come from how the field computer is configured) |
Target Rate Max | float | NA | The maximum rate this product was applied (units come from how the field computer is configured) |
Geospatial Min Value | float | ||
Geospatial Max Value | float | ||
Geospatial Avg Value | float | ||
Geospatial Acres | float | ||
Is Mixed | bit | NA | Boolean value indicating if this product is mixed |
List of ingredients for this product(included if Is Mixed value is TRUE). Each ingredient has the following: | |||
ID | int | NA | Internal id of this ingredient |
Name | nvarchar(50) | NA | Text entered by operator |
Manufacturer | nvarchar(50) | NA | Text entered by operator |
EPA Number | nvarchar(50) | NA | Text entered by operator |
Target Pests | nvarchar(50) | NA | Text entered by operator |
Mix Ratio | nvarchar(50) | NA | Text entered by operator |
Field name | Data type | Unit\Format | Description |
---|---|---|---|
List of products for this job.Each product has the following | |||
ID | int | NA | Internal id of the product in slingshot |
Product name | nvarchar(100) | NA | The name of the product as entered into the field computer screens |
Applied area | float | square meter | The total area of the job |
Target Rate | float | NA | The target rate for this product (units are however the field computer is configured) |
Target Minimum | float | NA | The minimum rate that was used for this product (units are however the field computer is configured) |
Target Maximum | float | NA | The maximum rate that was used for this product (units are however the field computer is configured) |
float | kg / ha | The average weight per area (in kg / ha) |
Field name | Data type | Unit\Format | Description |
---|---|---|---|
ID | int | N/A | Product sequential number |
Type | string | N/A | Applied Product type |
Brand | string | N/A | Applied Product provider |
Variety | string | N/A | Applied Product name |
Row | int | Comma Separated Values | List of implement positions used for the applied product |
Field name | Data type | Unit\Format | Description |
---|---|---|---|
List of products for this job. Each product has the following | |||
ID | int | NA | Internal id of the product in slingshot |
Product Name | nvarchar(100) | NA | The name of the product as entered into the field computer screens |
Applied Area | float | square meter | The total area of the job |
Total Weight | float | kg | The total weight (in kg) of the job |
Total Bushels | float | bushels | The total volume |
Average Weight per Area | float | kg / ha | The average weight per area (in kg / ha) |
Most of the Field Hub related API calls will return data that is coming into the Slingshot system from the Field Hub itself. This page will help you to interpret these values.
"" - Roaming status cannot be determined. "00" - Field Hub is not roaming. Any other value - Field Hub is roaming.
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
6 1000 false false 0 1 6565 30Nov2012 https://api.ravenslingshot.com/fieldcomputers/6565 6056 3-7-0-73 https://api.ravenslingshot.com/fieldcomputers/6056 5886 9-12-12 https://api.ravenslingshot.com/fieldcomputers/5886 5780 30Aug2012 https://api.ravenslingshot.com/fieldcomputers/5780 5718 24Aug2912 https://api.ravenslingshot.com/fieldcomputers/5718 5075 5057-3 https://api.ravenslingshot.com/fieldcomputers/5075
{ "FieldComputer" : [ { "ID" : 6565, "Name" : "30Nov2012", "Uri" : "https://api.ravenslingshot.com/fieldcomputers/6565" }, { "ID" : 6056, "Name" : "3-7-0-73", "Uri" : "https://api.ravenslingshot.com/fieldcomputers/6056" }, { "ID" : 5886, "Name" : "9-12-12", "Uri" : "https://api.ravenslingshot.com/fieldcomputers/5886" }, { "ID" : 5780, "Name" : "30Aug2012", "Uri" : "https://api.ravenslingshot.com/fieldcomputers/5780" }, { "ID" : 5718, "Name" : "24Aug2912", "Uri" : "https://api.ravenslingshot.com/fieldcomputers/5718" }, { "ID" : 5075, "Name" : "5057-3", "Uri" : "https://api.ravenslingshot.com/fieldcomputers/5075" } ], "TotalCount" : 6, "PageSize" : 20, "IsPreviousPage" : false, "IsNextPage" : false, "PageIndex" : 0, "TotalPages" : 1 }
{id} | The {id} portion of the URI is taken from the XML Document returned by a GET request to the /FieldComputers URI. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
6565 30Nov2012 Viper Pro Not In Job false false 09613471299 2012-11-30T19:59:57Z
{ "ID" : 6565, "Name" : "30Nov2012", "DeviceType" : "Viper Pro", "Status" : "Not In Job", "RemoteAccess" : false, "WebAccess" : false, "FieldHubID" : "09613471299", "LastReportDate" : "2012-11-30T19:59:57Z" }
{id} | The {id} portion of the URI is taken from the XML Document returned by a GET request to the /FieldComputers URI. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
state | [Optional] queued or validated (default) |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
3 20 false false 0 1 8131950 carrier1.zip https://api.ravenslingshot.com/PrescriptionMaps/8131950 Prescription Map
{ "TotalCount" : 3, "PageSize" : 20, "IsPreviousPage" : false, "IsNextPage" : false, "PageIndex" : 0, "TotalPages" : 1, "PrescriptionMap" : [ { "ID" : 8131950, "Name" : "carrier1.zip", "Uri" : "https://api.ravenslingshot.com/PrescriptionMaps/8131950", "SubType" : "Prescription Map" } ] }
{id} | The {id} portion of the URI is taken from the XML Document returned by a GET request to the /FieldComputers URI. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
minid | [Optional] Minimum file ID in results. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
8 20 false false 0 1 7923138 Boom Switches.jdp.zip https://api.ravenslingshot.com/JobData/7923138 As Applied 7922473 Boom Switches.jdp.zip https://api.ravenslingshot.com/JobData/7922473 As Applied
{ "JobData" : [ { "ID" : 7923138, "Name" : "Boom Switches.jdp.zip", "Uri" : "https://api.ravenslingshot.com/JobData/7923138", "SubType" : "As Applied" }, { "ID" : 7922473, "Name" : "Boom Switches.jdp.zip", "Uri" : "https://api.ravenslingshot.com/JobData/7922473", "SubType" : "As Applied" } ], "TotalCount" : 8, "PageSize" : 20, "IsPreviousPage" : false, "IsNextPage" : false, "PageIndex" : 0, "TotalPages" : 1 }
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
1 20 false false 0 1 114871 9940 Field Computer 0 0 0 0 0 false 0000-00-00 00:00:00
{ "DeviceLocation": [ { "ID": "114871", "DeviceId": "9940", "SubType": "Field Computer", "Lat": 0, "Lon": 0, "Alt": 0, "Speed": 0, "Direction": 0, "Valid": false, "GPSDateTime": "0000-00-00 00:00:00" } ], "TotalCount": 1, "PageSize": 20, "IsPreviousPage": false, "IsNextPage": false, "PageIndex": 0, "TotalPages": 1 }
{id} | The {id} portion of the URI is taken from the XML Document returned by a GET request to the /FieldComputers URI. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
1 20 false false 0 1 114871 9940 Field Computer 0 0 0 0 0 false 0000-00-00 00:00:00
{ "DeviceLocation": [ { "ID": "114871", "DeviceId": "9940", "SubType": "Field Computer", "Lat": 0, "Lon": 0, "Alt": 0, "Speed": 0, "Direction": 0, "Valid": false, "GPSDateTime": "0000-00-00 00:00:00" } ], "TotalCount": 1, "PageSize": 20, "IsPreviousPage": false, "IsNextPage": false, "PageIndex": 0, "TotalPages": 1 }
{id} | The {id} portion of the URI is taken from the XML Document returned by a GET request to the /FieldComputers URI. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
8 20 false false 0 1 114871 9940 Field Computer 0 0 0 0 0 false 0000-00-00 00:00:00 114870 9940 Field Computer 0 0 0 0 0 false 0000-00-00 00:00:00
{ "DeviceLocation": [ { "ID": "114871", "DeviceId": "9940", "SubType": "Field Computer", "Lat": 0, "Lon": 0, "Alt": 0, "Speed": 0, "Direction": 0, "Valid": false, "GPSDateTime": "0000-00-00 00:00:00" }, { "ID": "114870", "DeviceId": "9940", "SubType": "Field Computer", "Lat": 0, "Lon": 0, "Alt": 0, "Speed": 0, "Direction": 0, "Valid": false, "GPSDateTime": "0000-00-00 00:00:00" } ], "TotalCount": 8, "PageSize": 20, "IsPreviousPage": false, "IsNextPage": false, "PageIndex": 0, "TotalPages": 1 }
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
24 2 false true 0 12 7804749 PrescriptionMap.zip https://api.ravenslingshot.com/PrescriptionMaps/7804749 Prescription Map
{ "TotalCount" : 24, "PageSize" : 2, "IsPreviousPage" : false, "IsNextPage" : true, "PageIndex" : 0, "TotalPages" : 12, "PrescriptionMap" : [ { "ID" : 7804749, "Name" : "PrescriptionMap.zip", "Uri" : "https://api.ravenslingshot.com/PrescriptionMaps/7804749", "SubType" : "Prescription Map" }, { "ID" : 7798049, "Name" : "PrescriptionMap.zip", "Uri" : "https://api.ravenslingshot.com/PrescriptionMaps/7798049", "SubType" : "Prescription Map" } ] }
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
Roundup.zip 2013-04-30T19:54:01.873Z 2013-04-30T19:54:39.057Z SENT_TO_DEVICE PrescriptionMap Roundup.zip https://api.ravenslingshot.com/PrescriptionMaps/8750738?format=bin bin
{ "DeviceFileName" : "Roundup.zip", "CreateDate" : "2013-04-30T19:54:01.873Z", "UpdateDate" : "2013-04-30T19:54:39.057Z", "Status" : "SENT_TO_DEVICE", "JobType" : "PrescriptionMap", "AvailableFiles" : [ { "FileName" : "Roundup.zip", "Uri" : "https://api.ravenslingshot.com/PrescriptionMaps/8750738?format=bin", "FileType" : "bin" } ] }
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
date | [Optional] Date in ISO8601 format(Example:2022-02-28 19:00:000). |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
177 20 false true 0 9 11 Large file2.zip https://api.ravenslingshot.com/JobData/11 Sprayer 2017-01-11T20:53:49Z 2017-01-11T20:54:01Z 12 Large file3.zip https://api.ravenslingshot.com/JobData/12 Sprayer 2017-01-11T21:55:49Z 2017-01-11T21:55:01Z
{ "JobData": [ { "ID": "11", "Name": "Large file2.zip", "Uri": "https:\/\/api.ravenslingshot.com\/JobData\/11", "SubType": "Sprayer", "CreateDate": "2017-01-11T20:53:49Z", "UpdateDate": "2017-01-11T20:54:01Z" }, { "ID": "12", "Name": "Large file3.zip", "Uri": "https:\/\/api.ravenslingshot.com\/JobData\/12", "SubType": "Sprayer", "CreateDate": "2017-01-11T20:55:49Z", "UpdateDate": "2017-01-11T20:55:01Z" } ], "TotalCount": 177, "PageSize": 20, "IsPreviousPage": false, "IsNextPage": true, "PageIndex": 0, "TotalPages": 9 }
NO_COVERAGE No coverage available. nil
MORE_TIME_NEEDED 00:00:30
{id} | The {id} portion of the URI is taken from the XML Document returned by a GET request to the /JobData URI. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
{id} | The {id} portion of the URI is taken from the XML Document returned by a GET request to the /JobData URI. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
{id} | The {id} portion of the URI is taken from the XML Document returned by a GET request to the /FieldHub URI. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
1 20 false false 0 1 249329618 352974026203117 Field Hub 43.550893833333 -96.7248445 454 0 0 false 2013-05-06T17:10:31Z
{ "DeviceLocation": [ { "ID": "249329618", "DeviceId": "352974026203117", "SubType": "Field Hub", "Lat": 43.550893833333, "Lon": -96.7248445, "Alt": 454, "Speed": 0, "Direction": 0, "Valid": false, "GPSDateTime": "2013-05-06T17:10:31Z" } ], "TotalCount": 1, "PageSize": 20, "IsPreviousPage": false, "IsNextPage": false, "PageIndex": 0, "TotalPages": 1 }
{id} | The {id} portion of the URI is taken from the XML Document returned by a GET request to the /FieldHub URI. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
1 20 false false 0 1 249329823 352974026203117 Field Hub 43.550893333333 -96.724844333333 454 0 0 false 2013-05-06T17:20:01Z
{ "DeviceLocation": [ { "ID": "249329823", "DeviceId": "352974026203117", "SubType": "Field Hub", "Lat": 43.550893333333, "Lon": -96.724844333333, "Alt": 454, "Speed": 0, "Direction": 0, "Valid": false, "GPSDateTime": "2013-05-06T17:20:01Z" } ], "TotalCount": 1, "PageSize": 20, "IsPreviousPage": false, "IsNextPage": false, "PageIndex": 0, "TotalPages": 1 }
{id} | The {id} portion of the URI is taken from the XML Document returned by a GET request to the /FieldHub URI. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
date | [Optional] Date in ISO8601 format(Example:2022-02-28 19:00:000). |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
{ "DeviceLocation": [ { "ID": "249329823", "DeviceId": "352974026203117", "SubType": "Field Hub", "Lat": 43.550893333333, "Lon": -96.724844333333, "Alt": 454, "Speed": 0, "Direction": 0, "Valid": false, "GPSDateTime": "2013-05-06T17:20:01Z" } ], "TotalCount": 1, "PageSize": 20, "IsPreviousPage": false, "IsNextPage": false, "PageIndex": 0, "TotalPages": 1 }
{ "DeviceLocation": [ { "ID": "249329823", "DeviceId": "352974026203117", "SubType": "Field Hub", "Lat": 43.550893333333, "Lon": -96.724844333333, "Alt": 454, "Speed": 0, "Direction": 0, "Valid": false, "GPSDateTime": "2013-05-06T17:20:01Z" } ], "TotalCount": 1, "PageSize": 20, "IsPreviousPage": false, "IsNextPage": false, "PageIndex": 0, "TotalPages": 1 }
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
1 20 false false 0 1 12345678910 Jack ICE ATT BlueTree Wireless-Sixnet BT-5800v2 54321 249330172 12345678910 Field Hub 43.550889833333 -96.724843166667 454 0 0 false 2013-05-06T17:37:32Z true 30 -69 true 1 8 false false false false false false false 0 0 0 0 12.6032 AT&T 15 0 HSPA 2013-05-06 17:37:34
{ "FieldHubDetail": [ { "ID": "12345678910", "Name": "Robert Potter 1", "Model": "BT-5630v2", "FieldComputer": "54321", "Report": { "ID": "252400163", "DeviceId": "12345678910", "SubType": "Field Hub", "Lat": 0, "Lon": 0, "Alt": 0, "Speed": 0, "Direction": 0, "Valid": true, "GPSDateTime": "0000-00-00T00:00:00Z", "Active": false, "Event": "30", "RSSI": -68, "Ignition": true, "GPSFix": 0, "GPSSat": 0, "DigitalInput1": false, "DigitalInput2": false, "DigitalInput3": false, "DigitalInput4": false, "DigitalOutput1": false, "DigitalOutput2": false, "DigitalOutput3": false, "AnalogInput1": 0, "AnalogInput2": 0, "AnalogInput3": 0, "AnalogInput4": 0, "BatteryVoltage": 12.5677, "Carrier": "Verizon", "Odometer": 0, "Roam": "0", "Service": "EVDO.A", "ServerDateTime": "2013-07-18T20:59:26Z" } }, { "ID": "12345678910", "Name": "Robert Potter 2", "Model": "BT-5630v2", "Report": { "ID": "252399618", "DeviceId": "12345678910", "SubType": "Field Hub", "Lat": 0, "Lon": 0, "Alt": 0, "Speed": 0, "Direction": 0, "Valid": true, "GPSDateTime": "0000-00-00T00:00:00Z", "Active": false, "Event": "30", "RSSI": -55, "Ignition": true, "GPSFix": 0, "GPSSat": 0, "DigitalInput1": false, "DigitalInput2": false, "DigitalInput3": false, "DigitalInput4": false, "DigitalOutput1": false, "DigitalOutput2": false, "DigitalOutput3": false, "AnalogInput1": 0, "AnalogInput2": 0, "AnalogInput3": 0, "AnalogInput4": 0, "BatteryVoltage": 12.6032, "Carrier": "Verizon", "Odometer": 0, "Roam": "0", "Service": "EVDO.A", "ServerDateTime": "2013-07-18T20:44:56Z" } } ], "TotalCount": 16, "PageSize": 20, "IsPreviousPage": false, "IsNextPage": false, "PageIndex": 0, "TotalPages": 1 }
{id} | The {id} portion of the URI is taken from the XML Document returned by a GET request to the /FieldHub URI. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
1 20 false false 0 1 12345678910 18March2013 BlueTree Wireless-Sixnet BT-5600v2 54321 197969991 12345678910 Field Hub 43.550506666667 -96.7248855 447 0 46 true 2013-04-09T21:57:43ZZ false 30 -55 true 1 10 false false false false false false false 0 0 0 0 13.8065 Verizon 0 00 1xRTT 2012-11-09T09:59:24Z
{ "FieldHubDetail": [ { "ID": "12345678910", "Name": "18March2013", "Make": "BlueTree Wireless-Sixnet", "Model": "BT-5600v2", "FieldComputer": "54321", "Report": { "ID": "197969991", "DeviceId": "12345678910", "SubType": "Field Hub", "Lat": 43.550506666667, "Lon": -96.7248855, "Alt": 447, "Speed": 0, "Direction": 46, "Valid": true, "GPSDateTime": "2013-04-09T21:57:43ZZ", "Active": false, "Event": "30", "RSSI": -55, "Ignition": true, "GPSFix": 1, "GPSSat": 10, "DigitalInput1": false, "DigitalInput2": false, "DigitalInput3": false, "DigitalInput4": false, "DigitalOutput1": false, "DigitalOutput2": false, "DigitalOutput3": false, "AnalogInput1": 0, "AnalogInput2": 0, "AnalogInput3": 0, "AnalogInput4": 0, "BatteryVoltage": 13.8065, "Carrier": "Verizon", "Odometer": 0, "Roam": "00", "Service": "1xRTT", "ServerDateTime": "2012-11-09T09:59:24Z" } } ], "TotalCount": 1, "PageSize": 20, "IsPreviousPage": false, "IsNextPage": false, "PageIndex": 0, "TotalPages": 1 }
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
09613471299 18March2013 https://api.ravenslingshot.com/FieldHubs/09613471299 352974026203117 Jack ICE ATT https://api.ravenslingshot.com/FieldHubs/352974026203117 2 20 0 1 false false
{ "FieldHub":[ { "ID":"09613471299", "Name":"18March2013", "Uri":"https://api.ravenslingshot.com/FieldHubs/09613471299" }, { "ID":"352974026203117", "Name":"Jack ICE ATT", "Uri":"https://api.ravenslingshot.com/FieldHubs/352974026203117" } ], "TotalCount":2, "PageSize":20, "PageIndex":0, "TotalPages":1, "IsPreviousPage":false, "IsNextPage":false }
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
B3A3B66E-413E-4018-8782-D297F4950F12 10 John's access key Key given to John to manage my data true RavenCustomer@gmail.com 2010-11-17T06:00:00Z
{ "AccessKey":"B3A3B66E-413E-4018-8782-D297F4950F12", "ID":"10", "FriendlyName":"John's access key", "Description":"Key given to John to manage my data", "IsActive":true, "Contact":"RavenCustomer@gmail.com", "ExpirationDateTime":"2010-11-17T06:00:00Z" }
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
{id} | The {id} portion of the URI is taken from the XML Document returned by a GET request to the /GrainCart URI. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
pagesize | [Optional] Number of rows to return for a result page. More. |
page | [Optional] Specific result page to return. More. |
X-SS-AccessKey | [Required] Token issued to a Slingshot user from the Raven Slingshot Portal Server. More. |
X-SS-APIKey | [Required] Token issued to the Slingshot developer from Raven. More |
X-SS-Signature | [Required] The signature generated for a specific request. More. |
X-SS-TimeStamp | [Required] The timestamp of when the request was generated. More. |
Getting the GPS Location of a Field Computer consists of 2 steps:
To determine the ID of the Field Computer to be located, the API Client needs to issue a GET request to the /FieldComputers URI and allow the user to choose the Field Computer from their list of Field Computers. The response to a GET request to the /FieldComputers URI will be:
2 20 false false 0 1 2058 VPRO4 T380 https://api.ravenslingshot.com/FieldComputers/2058 2558 E-Pro II B2 https://api.ravenslingshot.com/FieldComputers/2558
This response can be parsed using the SlingshotIndex.xsd schema. Once the user picks a Field Computer, the API Client will need to save the Uri value of the chosen Field Computer to use in Step 2.
There are two calls that an API Client can make to determine the GPS Location of the chosen Field Computer.
A GET call to /FieldComputers/{fcID}/CurrentLocation will return a Slingshot Index response containing a single record that contains the most recent GPS location reported into the Slingshot system by the Field Computer represented by {fcID}. This record will contain the Latitude, Longitude, Altitude, Speed, Direction, and a DateTime stamp of when the record was created:
1 20 false false 0 1 253006 1092 Field Computer 0.00000000 0.00000000 0 0 0 2010-10-05T18:03:20Z
A GET call to /FieldComputers/{fcID}/Locations will return a Slingshot Index response containing multiple records that contain the GPS Location reported into the Slingshot system by the Field Computer represented by {fcID} over time. By default, the Slingshot API Server will return 20 records per request, but this value can be controlled by adding the query string parameter pageSize to the GET call.
1990 20 false true 0 100 253006 1092 Field Computer 0.00000000 0.00000000 0 0 0 2010-10-05T18:03:20Z 253005 1092 Field Computer 0.00000000 0.00000000 0 0 0 2010-10-05T17:58:10Z
Both of these responses can be parsed using the SlingshotIndex.xsd schema file. The data types and units are also documented in the SlingshotIndex.xsd schema file.
If the Slingshot API Server can determine which Field Hub a specific Field Computer is using, the API server will return the GPS Location records of the Field Hub and the SubType element of these records will be 'Field Hub'. If the Slingshot API Server cannot determine which Field Hub a Field Computer is using, it will return the GPS Location records of the Field Computer and the SubType of these records will be 'Field Computer'. Currently, GPS Location records come in from Field Hubs every 30 seconds and GPS Location records come in from Field Computers ever 5 minutes.
Getting the GPS Location of more than one Field Computer in a single API call.
Both of these calls support the special value of 'all' for {fcID}. When this value is used for {fcID}, the Slingshot API Server will return the a Slingshot Index response containing the most recent GPS Location for each Field Computer that the user has access to. A call to /FieldComputers/all/CurrentLocation will return a single GPS Location for each Field Computer. In contrast, a call to /FieldComputers/all/Locations will return multiple GPS Locations for each Field Computer and this result set could be quite large. At this time, however, the call to /FieldComputers/all/Locations is not implemented.
Uploading a Rx Map and sending it to a Field Computer consists of 3 steps:
To determine the ID of the Field Computer that should receive the Rx Map, the API Client needs to issue a GET request to the /FieldComputers URI and allow the user to choose the Field Computer from their list of Field Computers. The response to a GET request to the /FieldComputers URI will be:
2 20 false false 0 1 2058 VPRO4 T380 https://api.ravenslingshot.com/FieldComputers/2058 2558 E-Pro II B2 https://api.ravenslingshot.com/FieldComputers/2558
Once the user picks a Field Computer, the API Client will need to save the Uri value of the chosen Field Computer to use in Step 3.
To upload the Rx Map to the Slingshot API Server, the API Client will issue a POST request to the /PrescriptionMaps URI. The POST request body will need to be in the multipart/form-data format. Please see the code sample for more information on the exact format. The POST request body will consist of two parts: a text parameter named FileType and the binary contents parameter named FileName. The FileType parameter should have either the value "RX" or "AGX", which tells the Slingshot API Server which type of file you are uploading. The FileName parameter will be a byte stream of the zipped file along with the name the file should be saved with. Again, more details are in the code sample.
If the POST request is successful, the Slingshot API Server will return a "201 Created" response to the API client along with an XML document that contains the URI of the newly POSTed file. The API Client will need to save this URI path for use in Step 3.
To direct the Slingshot API Server to send the Rx Map to the chosen Field Computer the API Client will issue a PUT request to /PrescriptionMaps/{rxID}/FieldComputers/{fcID} where {rxID} is the ID returned by the POST request in Step 2 and {fcID} is the ID of the chosen field computer from Step 1.
If successful, the Slingshot API Server will respond with "200 OK". If the request fails, the Slingshot API Server will return the appropriate error code.
If a file with the same {rxID} is already queued for the field computer {fcID}, an appropriate message to wait will be returned and the file will NOT be queued.
If a file with the same file-name as {rxID} is already queued for the field computer {fcID}, an appropriate message indicating name conflict will be returned and the file will NOT be queued.
If all of the calls were successful, the Slingshot API Server will ensure that the POSTed file is made available for the Field Computer to download. The Field Computers currently have a timer which they use to check with the Slingshot system for files to be downloaded, so the file will not arrive at the Field Computer immediately, but will arrive after the timer fires and the Field Computer requests the file from Slingshot. The actual download time will vary depending on the speed of the Field Computer's connection to the Internet.
$method = "POST"; //initialize curl $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, "https://api.ravenslingshot.com/PrescriptionMaps"); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); //create header for authentication $header = getHeaders($method, "api.ravenslingshot.com", strtolower ("/PrescriptionMaps")); array_push($header, 'Accept: application/xml'); curl_setopt($curl, CURLOPT_HTTPHEADER, $header); //handle file upload if($method == "POST") { //it is a post curl_setopt($curl, CURLOPT_POST, true); $filePath = 'C:\PrescriptionMap.zip'; //file location //array for file information $postData = array( "FileType" => "RX",//or AGX "FileName" => "@".realpath($filePath) ); //attach filetype and filename curl_setopt($curl, CURLOPT_POSTFIELDS, $postData); } //handle file ends here //make the call $curl_response = curl_exec($curl); //pretty print echo "".htmlentities($curl_response).""; curl_close($curl);