Download Request
The following is an example REST/JSON download request:
GET /routelink/v1/download HTTPS/1.1
Authorization: Bearer c0d97b52-35d9-32c2-a37d-6126a186a844
There are several tools that can be used to aid in the initial development of the download. Below is an example that can be used in a UNIX environment.
The wget tool can issue a download like this example:
wget --header="Authorization: Bearer c0d97b52-35d9-32c2-a37d-6126a186a844" https://api-routelink.somos.com/routelink/v1/download
More generally the wget command is using the access token as follows:
wget --header="Authorization: Bearer <insert your access token here>" https://api-routelink.somos.com/routelink/v1/download
The download request can download several messages at once. The maximum number of messages is 5,000 at one time. To download a specific number of messages, include the number of messages at the end or the URL as follows:
wget --header="Authorization: Bearer <insert your access token here>" https://api-routelink.somos.com/routelink/v1/download/1000
In the above example, the RouteLink Client is requesting 1,000 messages. If the /1000 portion of the URL is not included, RouteLink Server will return a default number of messages to the RouteLink Client. This optional message count is a maximum number of messages the RouteLink Client is requesting so RouteLink Server will return up to that number of updates, depending on the number of available updates for the RouteLink Client.
The RouteLink Client SHOULD also send to RouteLink Server the last message index that it received (see message response below). The following example demonstrates the correct syntax:
wget --header="Authorization: Bearer <insert your access token here>" https://api-routelink.somos.com/routelink/v1/download/1000?lastIndex=78233
In the above case, the RouteLink Server will return 1,000 messages to the RouteLnk Client where the id is greater than 78233. The id value ranges from 0 to 2^63 -1 (9,223,372,036,854,775,807). Although the lastIndex parameter is not required, it allows RouteLink Server to verify that last set of messages received by the RouteLink Client.