pagecontent = [ { id: 'reference', navigationtitle: "Reference", title: 'NFleet REST Reference', toc: true, sections: [ { title: 'API Endpoints', id: 'apiendpoints', codetitle: 'Accessing API', paragraphs: [ { text: "NFleet service API endpoint can be accessed through https://api.nfleet.fi.", notes: [{ text: "The API can only be accessed through HTTPS. The HTTP port 80 is permanently closed for security reasons."}] }, { text: "The example assumes authentication and authorization has been completed before accessing the root object. Refer to the next section for the authentication procedure." } ], codeparagraphs: [{"id":"accessingapi","description":"Accessing the NFleet API:","codetypes":[{"id":"curl","text":"curl -i -k -X GET https://api.nfleet.fi \r\n -H \"Authorization: Bearer TOKEN_HERE\" \r\n -H \"Accept: application/json\""},{"id":"cs","text":"var api = new Api( url, clientKey, clientSecret );\r\nvar tokenResponse = api.Authenticate();\r\nvar rootLinks = api.Root;"},{"id":"java","text":"API api = new API(\"https://api.nfleet.fi\");\r\napi.authenticate(clientKey, clientSecret);\r\nApiData data = api.navigate(ApiData.class, api.getRoot());"}]}, {"id":"accessingapiresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 200 OK\r\nContent-Type: application/json; charset=utf-8\r\n{\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"\"\r\n },\r\n {\r\n \"Uri\":\"/users\",\r\n \"Rel\":\"list-users\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.userset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"/users\",\r\n \"Rel\":\"create-user\",\r\n \"Method\":\"POST\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.user+json;version=2.0\"\r\n }\r\n ]\r\n}"}]}, ] }, { title: 'Authentication', id: 'authentication', paragraphs: [ { text: "NFleet API uses two-legged OAuth 2 for authentication. The client requests an access token from the service using client credentials (client id and client secret) and uses the token in each subsequent request in the Authorization HTTP header. The token expires after a predefined time and should be renewed periodically.", }, ], codeparagraphs: [{"id":"oauth","description":"Authenticating to the service:","codetypes":[{"id":"curl","text":"curl -i -k -X POST https://api.nfleet.fi/tokens \r\n -u \"kz0jW9l980-jfvm3lAw-0a-w:j4-dsK8F23dsUIO_sIkf-s9laQc\" \r\n -H \"Content-Type: application/json\" \r\n -d '{\r\n \"Scope\": \"data optimization\"\r\n }'"},{"id":"cs","text":"var api = new Api(url, clientKey, clientSecret);"},{"id":"java","text":"api.authenticate(\"kz0jW9l980-jfvm3lAw-0a-w\", \"j4-dsK8F23dsUIO_sIkf-s9laQc\");"}]}, {"id":"oauthresp","description":"Sample response:","codetypes":[{"id":"curl","text":"HTTP/1.1 201 Created\r\nLocation: https://api.nfleet.fi/tokens/zotj6IcjAO3tmEnI2g-mW8ksfDk9amG"}]}, {"id":"token","description":"Completing the authentication with access token:","codetypes":[{"id":"curl","text":"curl -i -k -X GET https://api.nfleet.fi/tokens/otj6IcjAO3tmEnI2g-mW8ksfDk9amG \r\n -H \"Accept: application/json\""}]}, {"id":"tokenresp","description":"Sample response:","codetypes":[{"id":"curl","text":"HTTP/1.1 200 OK\r\nContent-Type: application/json; charset=utf-8\r\n{\r\n \"AccessToken\": \"otj6IcjAO3tmEnI2g-mW8ksfDk9amG\",\r\n \"ExpirationIn\": 3418,\r\n \"TokenType\": \"Bearer\",\r\n \"Scope\": \"data optimization\"\r\n}"}]}, ] }, { title: 'Hypertext Links', id: 'hypertextlinks', paragraphs: [ { text: "NFleet service API defines a set of resource types and their locations. When a new resource is created, its uniform resource identifier (URI) is provided to the client for accessing it later. This is done using the HTTP header Location. When a requested resource has additional subresources, links to them are provided within the meta property of the resource.", notes: [{ text: "The subresources are not guaranteed to retain their URIs, and it is advisable to refer to them via their hypertext relations."}] }, { title: "Link Data", text: "Link object defines the type of the relation to the resource, the link url and the appropriate HTTP method associated with this link.", tables: [{ rows: [ { name: "Rel", type: "string", description: "Name of the relation between the resources. Can be used to uniquely identify each subresource.", readonly: true }, { name: "Uri", type: "string", description: "The URI of the subresource.", readonly: true }, { name: "Method", type: "enum", description: "The HTTP method appropriate for this link: GET, POST, PUT, or DELETE.", readonly: true }, { name: "Type", type: "string", description: "Type of the resource.", readonly: true}, ] }] }, { text: "Note that the links contain a relative URI to the subresource. The absolute URI is formed by combining the endpoint address, the self link of the current resource, and the value of the Uri property of the link data object.", }, ], codeparagraphs: [{"id":"accessingproblem","description":"Accessing problem object:","codetypes":[{"id":"curl","text":"curl -i -X GET https://api.nfleet.fi/users/1/problems\r\n -H \"Accept: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\""},{"id":"cs","text":"var problem = api.Navigate( created.Location );"},{"id":"java","text":"RoutingProblemData problem = api.navigate(RoutingProblemData.class, created.getLocation());"}]}, {"id":"accessingproblemresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 200 OK\r\nContent-Type: application/vnd.jyu.nfleet.routingproblem+json;version=2.0\r\n{\r\n \"Id\":2,\r\n \"Name\":\"test\",\r\n \"CreationDate\":\"2013-11-22T09:42:48+02:00\",\r\n \"ModifiedDate\":\"2013-11-22T09:42:48+02:00\",\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"/users/1/problems/2\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.routingproblem+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"update\",\r\n \"Method\":\"PUT\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.routingproblem+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"/vehicles\",\r\n \"Rel\":\"list-vehicles\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicleset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"/vehicles\",\r\n \"Rel\":\"create-vehicle\",\r\n \"Method\":\"POST\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicle+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"/tasks\",\r\n \"Rel\":\"create-task\",\r\n \"Method\":\"POST\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.task+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"/tasks\",\r\n \"Rel\":\"list-tasks\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.taskset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"/objective-values\",\r\n \"Rel\":\"objective-values\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.objectivevalueset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"toggle-optimization\",\r\n \"Method\":\"PUT\",\r\n \"Enabled\":false,\r\n \"Type\":\"application/vnd.jyu.nfleet.routingproblem+json;version=2.0\"\r\n }\r\n ],\r\n \"State\":\"Stopped\",\r\n \"Progress\":0\r\n}"}]}, ] }, { title: 'Users', id: 'users', codetitle: 'Manipulating Users', paragraphs: [ { title: "User Data", text: "User represents a resource that has a collection of subresources such as routing problems, vehicles and tasks.", tables: [{ rows: [ { name: "Id", type: "integer", description: "Human-readable name of this resource. Does not have to be unique.", readonly: true }, { name: "Meta", type: "Link list", description: "List of hypertext links in this resource.", readonly: true }, ] }], }, ], codeparagraphs: [{"id":"creatingauser","description":"Creating a user: ","codetypes":[{"id":"curl","text":"curl -i -k -X POST https://api.nfleet.fi/users/\r\n -H \"Authorization: Bearer TOKEN_HERE\" \r\n -H \"Accept: application/json\" \r\n -H \"Content-Type: application/json\"\r\n -d ' { \"Name\": \"Marko\" } '"},{"id":"cs","text":"var users = api.Navigate( api.Root.GetLink( \"list-users\" ) );\r\nvar response = api.Navigate( users.GetLink( \"create\" ) );\r\nvar user = api.Navigate( response.Location );"},{"id":"java","text":"UserDataSet users = api.navigate(UserDataSet.class, data.getLink(\"list-users\"));\r\nArrayList before = users.getItems();\r\nResponseData result = api.navigate(ResponseData.class, users.getLink(\"create\"), new UserUpdateRequest());"}]}, {"id":"createuserresp","description":"Sample response: ","codetypes":[{"id":"any","text":"HTTP/1.1 201 Created \r\nContent-Type: application/json \r\nContent-Length: 0 \r\nLocation: https://api.nfleet.fi/users/1"}]}, ] }, { title: 'Routing Problems', id: 'routingproblems', codetitle: 'Manipulating Routing Problems', paragraphs: [ { title: "Routing Problem Data", text: "Routing problem object represents a collection of vehicles, tasks, and locations to which an optimization operations can be performed.", tables: [{ rows: [ { name: "Id", type: "integer", description: "Unique identifier for this resource.", readonly: true }, { name: "Meta", type: "Link list", description: "List of hypertext links in this resource.", readonly: true }, { name: "Name", type: "string", description: "Human-readable name of this resource. Does not have to be unique.", required: true }, { name: "CreationDate", type: "date-time", description: "The time this resource has been created.", readonly: true }, { name: "ModifiedDate", type: "date-time", description: "The previous time this resource has been modified.", readonly: true }, { name: "State", type: "enum", description: "State of the optimization process. For example: Stopped or Running."}, { name: "Progress", type: "integer", description: "Indicates the progress of optimization process.", readonly: true }, ] }], }, ], codeparagraphs: [{"id":"creatingproblem","description":"Creating a routing problem:","codetypes":[{"id":"curl","text":"curl -i -X POST https://api.nfleet.fi/users/1/problems \r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\" \r\n -d '{ \r\n \"Name\": \"Second test\" \r\n }' "},{"id":"cs","text":"var created = api.Navigate( user.GetLink( \"create-problem\" ), new RoutingProblemUpdateRequest { Name = \"test\" } );\r\nvar problem = api.Navigate( created.Location );"},{"id":"java","text":"RoutingProblemUpdateRequest update = new RoutingProblemUpdateRequest(\"TestProblem\");\r\nResponseData createdProblem = api.navigate(ResponseData.class, user.getLink(\"create-problem\"), update);\r\nRoutingProblemData problem = api.navigate(RoutingProblemData.class, createdProblem.getLocation());"}]}, {"id":"creatingproblemresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 201 Created \r\nContent-Type: application/json \r\nContent-Length: 0 \r\nLocation: https://api.nfleet.fi/users/1/problems/10"}]}, {"id":"accessingnewproblem","description":"Accessing the newly created problem:","codetypes":[{"id":"curl","text":"curl -i -X GET https://api.nfleet.fi/users/1/problems/6\r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\""},{"id":"cs","text":"var newProblem = api.Navigate(result.Location); "}]}, {"id":"accessingnewproblemresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 200 OK\r\nContent-Type: application/vnd.jyu.nfleet.routingproblem+json;version=2.0\r\n{\r\n \"VersionNumber\":1,\r\n \"Id\":5,\r\n \"Name\":\"test\",\r\n \"CreationDate\":\"2013-11-13T14:21:14+02:00\",\r\n \"ModifiedDate\":\"2013-11-13T14:21:14+02:00\",\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"/users/1/problems/5\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.routingproblem+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"update\",\r\n \"Method\":\"PUT\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.routingproblem+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"/vehicles\",\r\n \"Rel\":\"list-vehicles\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicleset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"/vehicles\",\r\n \"Rel\":\"create-vehicle\",\r\n \"Method\":\"POST\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicle+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"/tasks\",\r\n \"Rel\":\"create-task\",\r\n \"Method\":\"POST\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.task+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"/tasks\",\r\n \"Rel\":\"list-tasks\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.taskset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"/objective-values\",\r\n \"Rel\":\"objective-values\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.objectivevalueset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"toggle-optimization\",\r\n \"Method\":\"PUT\",\r\n \"Enabled\":false,\r\n \"Type\":\"application/vnd.jyu.nfleet.routingproblem+json;version=2.0\"\r\n }\r\n ],\r\n \"State\":\"Stopped\",\r\n \"Progress\":0\r\n}"}]}, {"id":"getprogress","description":"Start optimization and get progress:","codetypes":[{"id":"curl","text":"curl -i -X GET https://api.nfleet.fi/users/1/problems/6\r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\""},{"id":"cs","text":"api.Navigate( problem.GetLink( \"toggle-optimization\" ),\r\n new RoutingProblemUpdateRequest { Name = problem.Name,\r\n State = \"Running\"\r\n } );\r\nwhile (true)\r\n{\r\n Thread.Sleep(100);\r\n var progress = api.Navigate(problem.GetLink(\"self\")).Progress;\r\n Console.WriteLine( \"Progress: \" + progress + \"%\" );\r\n if (progress >= 100) break;\r\n}\r\n"}]}, ] }, { title: 'Routing Problem Settings', id: 'settings', codetitle: 'Manipulating routing problem settings', paragraphs: [ { title: "Routing Problem Settings Data", text: "Problem settings object contains information about the speed profile and the speed factor that should be applied to a routing problem.", tables: [{ rows: [ { name: "Version number", type: "integer", description: "Version number of the resource.", readonly: true }, { name: "Meta", type: "Link list", description: "List of hypertext links in this resource.", readonly: true }, { name: "DefaultVehicleSpeedFactor", type: "double", description: "Default vehicle speed factor.", required: false }, { name: "DefaultVehicleSpeedProfile", type: "enum", description: "Default vehicle speed profile. Value can be either Max120Kmh, Max100Kmh, Max80Kmh, Max60Kmh or Max40Kmh. ", optional: false }, ] }] } ], codeparagraphs: [{"id":"updatingroutingproblemsettings","description":"Changing routing problem settings","codetypes":[{"id":"curl","text":"curl -i -X PUT https://api.co-sky.fi/users/1/problems/6/settings\r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\"\r\n -H \"If-None-Match: 2\" \r\n -d '\r\n {\r\n \"UserId\": 1,\r\n \"ProblemId\": 6,\r\n \"DefaultVehicleSpeedProfile\": \"Max120Kmh\",\r\n \"DefaultVehicleSpeedFactor\": 0.8,\r\n \"VersionNumber\": 1\r\n}' "},{"id":"cs","text":"var settings = api.Navigate( problem.GetLink( \"view-settings\" ) );\r\nvar updatedSettings = new RoutingProblemSettingsUpdateRequest { DefaultVehicleSpeedFactor = 0.8, DefaultVehicleSpeedProfile = SpeedProfile.Max120Kmh.ToString() };"},{"id":"java","text":"RoutingProblemSettingsData settings = api.navigate(RoutingProblemSettingsData.class, routingProblemData.getLink(\"view-settings\"));\r\nRoutingProblemSettingsUpdateRequest updatedSettings = new RoutingProblemSettingsUpdateRequest();\r\nupdatedSettings.setDefaultVehicleSpeedFactor(0.8);\r\nupdatedSettings.setDefaultVehicleSpeedProfile(SpeedProfile.Max120Kmh);"}]}, {"id":"updatingroutingproblemsettingsresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 200 OK\r\nContent-Type: application/vnd.jyu.nfleet.problemsettings+json;version=2.0\r\n{\r\n \"VersionNumber\": 1,\r\n \"DefaultVehicleSpeedFactor\": 0.7,\r\n \"DefaultVehicleSpeedProfile\": \"Max100Kmh\",\r\n \"Meta\":[\r\n {\r\n \"Uri\": \"/users/1/problems/6/settings\",\r\n \"Rel\": \"self\",\r\n \"Method\": \"GET\",\r\n \"Enabled\": true,\r\n \"Type\": \"application/vnd.jyu.nfleet.problemsettings+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\": \"\",\r\n \"Rel\": \"update-settings\",\r\n \"Method\": \"PUT\",\r\n \"Enabled\": false,\r\n \"Type\": \"application/vnd.jyu.nfleet.problemsettings+json;version=2.0\"\r\n }\r\n ]\r\n}"}]}, ] }, { title: 'Tasks', id: 'tasks', codetitle: 'Manipulating Tasks', paragraphs: [ { title: "Task Data", text: "Task object represents a single task which needs to be performed by a single vehicle. A task can comprise of several parts (task events) in different locations.", tables: [{ rows: [ { name: "Id", type: "integer", description: "Unique identifier for this resource.", readonly: true }, { name: "Meta", type: "Link list", description: "List of hypertext links in this resource.", readonly: true }, { name: "Name", type: "string", description: "Human-readable identifier of this resource. Does not have to be unique.", required: true }, { name: "Info", type: "string", description: "Additional information for identifying this task.", optional: true }, { name: "TaskEvents", type: "TaskEvent list", description: "List of task events comprising this task.", required: true }, ] }] }, { title: "TaskEvent Data", text: "Task event object represents a single part of a task.", tables: [{ rows: [ { name: "Id", type: "integer", description: "Unique identifier for this resource.", readonly: true }, { name: "Meta", type: "Link list", description: "List of hypertext links in this resource.", readonly: true }, { name: "Name", type: "string", description: "Human-readable identifier of this resource. Does not have to be unique.", required: true }, { name: "Info", type: "string", description: "Additional information for identifying this task task.", optional: true }, { name: "Type", type: "enum", description: "The type of this task event: Pickup or Delivery.", required: true }, { name: "Location", type: "Location", description: "Location of the task event.", required: true }, { name: "Capacities", type: "Capacity list", description: "List of capacity definitions for the vehicle.", required: true }, { name: "TimeWindows", type: "TimeWindow list", description: "List of availability time windows for the task event. Currently only one time window is supported.", required: true }, { name: "ServiceTime", type: "integer", description: "The time required to stop at the task event.", optional: true }, ] }] }, ], codeparagraphs: [{"id":"listingtasks","description":"Listing tasks of a problem:","codetypes":[{"id":"curl","text":"curl -i -X GET https://api.nfleet.fi/users/1/problems/6/tasks \r\n -H \"Accept: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\""},{"id":"cs","text":"var tasks = api.Navigate( problem.GetLink( \"list-tasks\" ) );"},{"id":"java","text":"TaskDataSet tasks = api.navigate(TaskDataSet.class, problem.getLink(\"list-tasks\"));"}]}, {"id":"listingtasksresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 200 OK \r\nContent-Type: application/vnd.jyu.nfleet.taskset+json;version=2.0 \r\n{\r\n \"Items\":[\r\n {\r\n \"Id\":1,\r\n \"Name\":\"task\",\r\n \"Info\":null,\r\n \"TaskEvents\":[\r\n {\r\n \"Id\":11,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":\"Pickup\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00\",\r\n \"End\":\"2013-05-14T12:00:00\"\r\n }\r\n ],\r\n \"Location\":{\r\n \"Id\":2,\r\n \"Coordinate\":{\r\n \"Latitude\":62.282617,\r\n \"Longitude\":25.797272,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n },\r\n {\r\n \"Id\":12,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":\"Delivery\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00\",\r\n \"End\":\"2013-05-14T12:00:00\"\r\n }\r\n ],\r\n \"Location\":{\r\n \"Id\":3,\r\n \"Coordinate\":{\r\n \"Latitude\":62.373658,\r\n \"Longitude\":25.885506,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n }\r\n ],\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"/users/1/problems/3/tasks/1\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.task+json;version=2.0\"\r\n }\r\n ],\r\n \"State\":\"Active\"\r\n }\r\n ],\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"/users/1/problems/3/tasks\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.taskset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"?limit=1&offset=0\",\r\n \"Rel\":\"current\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.taskset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"?limit=1&offset=0\",\r\n \"Rel\":\"first\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.taskset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"?limit=1&offset=0\",\r\n \"Rel\":\"prev\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.taskset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"?limit=1&offset=0\",\r\n \"Rel\":\"next\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.taskset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"?limit=1&offset=0\",\r\n \"Rel\":\"last\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.taskset+json;version=2.0\"\r\n }\r\n ]\r\n}\r\n\r\n"}]}, {"id":"creatingtask","description":"Creating a task:","codetypes":[{"id":"curl","text":"curl -i -X POST https://api.nfleet.fi/users/1/problems/6/tasks\r\n -H \"Authorization: Bearer TOKEN_HERE\" \r\n -H \"Accept: application/json\"\r\n -H \"Content-Type: application/json\" \r\n -d '{ \r\n \"Name\": \"test name\", \r\n \"TaskEvents\": [ \r\n { \r\n \"Type\": \"Pickup\", \r\n \"Location\": \r\n { \r\n \"Coordinate\": \r\n { \r\n \"Latitude\": \"62.244958\", \r\n \"Longitude\": \"25.747143\", \r\n \"System\": \"Euclidian\" \r\n },\r\n \"Address\":null \r\n }, \r\n \"Capacities\": [ \r\n { \r\n \"Name\": \"Weight\", \r\n \"Amount\": 20 \r\n } \r\n ] \r\n }, \r\n { \r\n \"Type\": \"Delivery\", \r\n \"Location\": \r\n { \r\n \"Coordinate\": \r\n { \r\n \"Latitude\": \"62.244589\", \r\n \"Longitude\": \"25.74892\", \r\n \"System\": \"Euclidian\" \r\n },\r\n \"Address\":null \r\n }, \r\n \"Capacities\": [ \r\n { \r\n \"Name\": \"Weight\", \r\n \"Amount\": 20 \r\n } \r\n ] \r\n } \r\n ] \r\n }' "},{"id":"cs","text":"var newTask = new TaskUpdateRequest { Name = \"test name\" };\r\nvar capacity = new CapacityData { Name = \"Weight\", Amount = 20 };\r\nvar pickup = new TaskEventUpdateRequest\r\n{\r\n Type = \"Pickup\",\r\n Location = new LocationData\r\n {\r\n Coordinate = new CoordinateData\r\n {\r\n Latitude = 62.244958,\r\n Longitude = 25.747143,\r\n System = \"Euclidian\"\r\n }\r\n }\r\n};\r\npickup.Capacities.Add( capacity );\r\nnewTask.TaskEvents.Add( pickup );\r\nvar delivery = new TaskEventUpdateRequest\r\n{\r\n Type = \"Delivery\",\r\n Location = new LocationData\r\n {\r\n Coordinate = new CoordinateData\r\n {\r\n Latitude = 62.244589,\r\n Longitude = 25.74892,\r\n System = \"Euclidian\"\r\n }\r\n }\r\n};\r\ndelivery.Capacities.Add( capacity );\r\nnewTask.TaskEvents.Add( delivery );\r\nvar taskCreationResult = api.Navigate( problem.GetLink( \"create-task\" ), newTask );\r\n\r\n\r\n"},{"id":"java","text":" \r\n CoordinateData pickup = new CoordinateData();\r\n pickup.setLatitude(54.14454);\r\n pickup.setLongitude(12.108808);\r\n pickup.setSystem(CoordinateSystem.Euclidian);\r\n LocationData pickupLocation = new LocationData();\r\n pickupLocation.setCoordinatesData(pickup);\r\n CoordinateData delivery = new CoordinateData();\r\n delivery.setLatitude(53.545867);\r\n delivery.setLongitude(10.276409);\r\n delivery.setSystem(CoordinateSystem.Euclidian);\r\n LocationData deliveryLocation = new LocationData();\r\n deliveryLocation.setCoordinatesData(delivery);\r\n ArrayList capacities = new ArrayList();\r\n capacities.add(new CapacityData(\"Weight\", 100000));\r\n ArrayList timeWindows = new ArrayList();\r\n Date morning = new Date();\r\n morning.setHours(7);\r\n Date evening = new Date();\r\n evening.setHours(16);\r\n timeWindows.add(new TimeWindowData(morning, evening));\r\n \r\n ArrayList taskCapacity = new ArrayList();\r\n taskCapacity.add(new CapacityData(\"Weight\", 1));\r\n \r\n ArrayList taskEvents = new ArrayList();\r\n taskEvents.add(new TaskEventUpdateRequest(Type.Pickup, pickupLocation, taskCapacity));\r\n taskEvents.add(new TaskEventUpdateRequest(Type.Delivery, deliveryLocation, taskCapacity));\r\n TaskUpdateRequest task = new TaskUpdateRequest(taskEvents);\r\n task.setName(\"testTask\");\r\n taskEvents.get(0).setTimeWindows(timeWindows);\r\n taskEvents.get(1).setTimeWindows(timeWindows);\r\n taskEvents.get(0).setServiceTime(10);\r\n taskEvents.get(1).setServiceTime(10);\r\n ResponseData result = api.navigate(ResponseData.class, problem.getLink(\"create-task\"), task);\r\n\r\n"}]}, {"id":"creatingataskresponse","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 201 Created \r\nContent-Type: application/json \r\nContent-Length: 0 \r\nLocation: https://api.nfleet.fi/users/1/problems/1/tasks/2"}]}, {"id":"importtaskset","description":"Mass import set of tasks:","codetypes":[{"id":"curl","text":"curl -i -X POST https://api.nfleet.fi/users/1/problems/6/tasks/import \r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\"\r\n -d '{\r\n \"Items\":[\r\n\t\t{\r\n \t\t\"Name\": \"test name\", \r\n \t\"TaskEvents\": [ \r\n { \r\n \"Type\": \"Pickup\", \r\n \"Location\": \r\n { \r\n \"Coordinate\": \r\n { \r\n \"Latitude\": \"62.244958\", \r\n \"Longitude\": \"25.747143\", \r\n \"System\": \"Euclidian\" \r\n },\r\n \"Address\":null \r\n }, \r\n \"Capacities\": [ \r\n { \r\n \"Name\": \"Weight\", \r\n \"Amount\": 20 \r\n } \r\n ] \r\n }, \r\n { \r\n \"Type\": \"Delivery\", \r\n \"Location\": \r\n { \r\n \"Coordinate\": \r\n { \r\n \"Latitude\": \"62.244589\", \r\n \"Longitude\": \"25.74892\", \r\n \"System\": \"Euclidian\" \r\n },\r\n \"Address\":null \r\n }, \r\n \"Capacities\": [ \r\n { \r\n \"Name\": \"Weight\", \r\n \"Amount\": 20 \r\n } \r\n ] \r\n }\r\n ]\r\n },\r\n {\r\n \t\t\"Name\": \"test name 2\", \r\n \t\"TaskEvents\": [ \r\n { \r\n \"Type\": \"Pickup\", \r\n \"Location\": \r\n { \r\n \"Coordinate\": \r\n { \r\n \"Latitude\": \"62.244958\", \r\n \"Longitude\": \"25.747143\", \r\n \"System\": \"Euclidian\" \r\n },\r\n \"Address\":null \r\n }, \r\n \"Capacities\": [ \r\n { \r\n \"Name\": \"Weight\", \r\n \"Amount\": 20 \r\n } \r\n ] \r\n }, \r\n { \r\n \"Type\": \"Delivery\", \r\n \"Location\": \r\n { \r\n \"Coordinate\": \r\n { \r\n \"Latitude\": \"62.244589\", \r\n \"Longitude\": \"25.74892\", \r\n \"System\": \"Euclidian\" \r\n },\r\n \"Address\":null \r\n }, \r\n \"Capacities\": [ \r\n { \r\n \"Name\": \"Weight\", \r\n \"Amount\": 20 \r\n } \r\n ] \r\n }\r\n ]\r\n },\r\n {\r\n \t\t\"Name\": \"test name 3\", \r\n \t\"TaskEvents\": [ \r\n { \r\n \"Type\": \"Pickup\", \r\n \"Location\": \r\n { \r\n \"Coordinate\": \r\n { \r\n \"Latitude\": \"62.244958\", \r\n \"Longitude\": \"25.747143\", \r\n \"System\": \"Euclidian\" \r\n },\r\n \"Address\":null \r\n }, \r\n \"Capacities\": [ \r\n { \r\n \"Name\": \"Weight\", \r\n \"Amount\": 20 \r\n } \r\n ] \r\n }, \r\n { \r\n \"Type\": \"Delivery\", \r\n \"Location\": \r\n { \r\n \"Coordinate\": \r\n { \r\n \"Latitude\": \"62.244589\", \r\n \"Longitude\": \"25.74892\", \r\n \"System\": \"Euclidian\" \r\n },\r\n \"Address\":null \r\n }, \r\n \"Capacities\": [ \r\n { \r\n \"Name\": \"Weight\", \r\n \"Amount\": 20 \r\n } \r\n ] \r\n }\r\n ]\r\n }\r\n ]\r\n }'"},{"id":"cs","text":"var importRequest = new TaskSetImportRequest\r\n{\r\n Items = new List()\r\n};\r\nfor (int i = 0; i < 10; i++)\r\n{\r\n var task = new TaskUpdateRequest { Name = \"test name\" };\r\n \r\n var pickup = new TaskEventUpdateRequest\r\n {\r\n Type = \"Pickup\",\r\n Location = new LocationData\r\n {\r\n Coordinate = new CoordinateData\r\n {\r\n Latitude = 62.244958,\r\n Longitude = 25.747143,\r\n System = \"Euclidian\"\r\n }\r\n }\r\n };\r\n pickup.Capacities.Add(capacity);\r\n task.TaskEvents.Add(pickup);\r\n var delivery = new TaskEventUpdateRequest\r\n {\r\n Type = \"Delivery\",\r\n Location = new LocationData\r\n {\r\n Coordinate = new CoordinateData\r\n {\r\n Latitude = 62.244589,\r\n Longitude = 25.74892,\r\n System = \"Euclidian\"\r\n }\r\n }\r\n };\r\n delivery.Capacities.Add(capacity);\r\n task.TaskEvents.Add(delivery);\r\n importRequest.Items.Add(task);\r\n}\r\nvar result = api.Navigate(problem.GetLink(\"import-tasks\"), importRequest);\r\n\r\n\r\n\r\n"},{"id":"java","text":"List tasks = new ArrayList();\r\n\t\r\n\tfor (int i = 0; i < 10; i++) {\r\n\t\tList taskEvents = new ArrayList();\r\n\t\tTaskEventUpdateRequest pickup = new TaskEventUpdateRequest(Type.Pickup, pickupLocation, list);\r\n\t\tTaskEventUpdateRequest delivery = new TaskEventUpdateRequest(Type.Delivery, deliveryLocation, list);\r\n\t\ttaskEvents.add(pickup); taskEvents.add(delivery);\r\n\t\tTaskUpdateRequest task = new TaskUpdateRequest(taskEvents);\r\n\t\ttask.setName(\"kivikasat\" + i);\r\n\t\ttasks.add(task);\r\n\t}\r\n\tTaskSetImportRequest set = new TaskSetImportRequest();\r\n\tset.setItems(tasks);\r\n\tResponseData result = api.navigate(ResponseData.class, problem.getLink(\"import-tasks\"), set);\r\n\tSystem.out.println(result.toString());"}]}, {"id":"importtasksetresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 201 Created \r\nContent-Type: application/json \r\nContent-Length: 0 \r\nLocation: https://api.nfleet.fi/users/1/problems/6/tasks"}]}, {"id":"updatingtask","description":"Updating the newly created task:","codetypes":[{"id":"curl","text":"curl -i -k -X PUT https://api.nfleet.fi/users/1/problems/6/tasks/13 \r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\"\r\n -H \"If-None-Match: 1\"\r\n -d '{ \r\n \"Name\": \"Other name\", \r\n \"TaskEvents\": [ \r\n { \r\n \"Type\": \"Pickup\", \r\n \"Location\": \r\n { \r\n \"Coordinate\": \r\n { \r\n \"Latitude\": \"62.244958\", \r\n \"Longitude\": \"25.747143\", \r\n \"System\": \"Euclidian\" \r\n },\r\n \"Address\":null \r\n }, \r\n \"Capacities\": [ \r\n { \r\n \"Name\": \"Weight\", \r\n \"Amount\": 20 \r\n } \r\n ] \r\n }, \r\n { \r\n \"Type\": \"Delivery\", \r\n \"Location\": \r\n { \r\n \"Coordinate\": \r\n { \r\n \"Latitude\": \"62.244589\", \r\n \"Longitude\": \"25.74892\", \r\n \"System\": \"Euclidian\" \r\n },\r\n \"Address\":null \r\n }, \r\n \"Capacities\": [ \r\n { \r\n \"Name\": \"Weight\", \r\n \"Amount\": 20 \r\n } \r\n ] \r\n } \r\n ] \r\n }' "},{"id":"cs","text":"var newTaskRequest = new TaskUpdateRequest\r\n {\r\n Info = task.Info,\r\n Name = \"Other name\",\r\n TaskEvents = oldTaskEvents,\r\n TaskId = task.Id,\r\n };\r\nvar newTaskLocation = api.Navigate( task.GetLink( \"update\" ), newTaskRequest );"},{"id":"java","text":"TaskUpdateRequest task = oldTask.toRequest();\r\ntask.setName(\"newName\");\r\nResponseData newTaskLocation = api.navigate(ResponseData.class, oldTask.getLink(\"update\"), task);"}]}, {"id":"updatingtaskresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 303 See Other\r\nLocation: https://api.nfleet.fi/users/1/problems/6/tasks/13"}]}, {"id":"deletingtask","description":"Deleting the newly created task:","codetypes":[{"id":"curl","text":"curl -i -X DELETE https://api.nfleet.fi/users/1/problems/6/tasks/13 \r\n -H \"Content-Type: application/json\"\r\n -H \"Accept: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\"\r\n -H \"If-None-Match: 1\""},{"id":"cs","text":"var deleteResponse = api.Navigate(newTask.GetLink(\"delete\"));"}]}, {"id":"deletingtaskresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 204 No Content \r\nContent-Type: application/json \r\nContent-Length: 0 "}]}, ] }, { title: 'Vehicles', id: 'vehicles', codetitle: 'Manipulating Vehicles', paragraphs: [ { title: "Vehicle Data", text: "Vehicle object represents an entity which can perform tasks in sequence.", tables: [{ rows: [ { name: "Id", type: "integer", description: "Unique identifier for this resource.", readonly: true }, { name: "Meta", type: "Link list", description: "List of hypertext links in this resource.", readonly: true }, { name: "Name", type: "string", description: "Human-readable name of this resource. Does not have to be unique.", required: true }, { name: "StartLocation", type: "Location", description: "The departure location of the vehicle.", required: true }, { name: "EndLocation", type: "Location", description: "The final arrival location of the vehicle.", required: true }, { name: "Capacities", type: "Capacity list", description: "List of capacity definitions for the vehicle.", required: true }, { name: "TimeWindows", type: "TimeWindow list", description: "List of availability time windows for the vehicle. Currently only one time window is supported.", optional: false }, ] }] }, ], codeparagraphs: [{"id":"listingvehicles","description":"Listing vehicles of a problem:","codetypes":[{"id":"curl","text":"curl -i -X GET https://api.nfleet.fi/users/1/problems/6/vehicles \r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\""},{"id":"cs","text":"var vehicles = api.Navigate( problem.GetLink( \"list-vehicles\" ) );"},{"id":"java","text":"VehicleDataSet vehicles = api.navigate(VehicleDataSet.class, problem.getLink(\"list-vehicles\"));"}]}, {"id":"listingvehiclesresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 200 OK \r\nContent-Type: application/vnd.jyu.nfleet.vehicleset+json;version=2.0 \r\n{\r\n \"Items\":[\r\n {\r\n \"Id\":1,\r\n \"Name\":\"test\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":5000\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00\",\r\n \"End\":\"2013-05-14T12:00:00\"\r\n }\r\n ],\r\n \"StartLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":{\r\n \"Latitude\":62.244958,\r\n \"Longitude\":25.747143,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"EndLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":{\r\n \"Latitude\":62.244958,\r\n \"Longitude\":25.747143,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"/users/1/problems/6/vehicles/1\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicle+json;version=2.0\"\r\n }\r\n ],\r\n \"State\":\"Active\"\r\n },\r\n {\r\n \"Id\":2,\r\n \"Name\":\"vehicle 2\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":3500\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00\",\r\n \"End\":\"2013-05-14T12:00:00\"\r\n }\r\n ],\r\n \"StartLocation\":{\r\n \"Id\":4,\r\n \"Coordinate\":{\r\n \"Latitude\":61.244958,\r\n \"Longitude\":20.747143,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"EndLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":{\r\n \"Latitude\":62.244958,\r\n \"Longitude\":25.747143,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"/users/1/problems/6/vehicles/2\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicle+json;version=2.0\"\r\n }\r\n ],\r\n \"State\":\"Active\"\r\n }\r\n ],\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"/users/1/problems/6/vehicles\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicleset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"?limit=2&offset=0\",\r\n \"Rel\":\"current\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicleset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"?limit=2&offset=0\",\r\n \"Rel\":\"first\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicleset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"?limit=2&offset=0\",\r\n \"Rel\":\"prev\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicleset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"?limit=2&offset=0\",\r\n \"Rel\":\"next\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicleset+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"?limit=2&offset=0\",\r\n \"Rel\":\"last\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicleset+json;version=2.0\"\r\n }\r\n ]\r\n}"}]}, {"id":"importvehicleset","description":"Mass import set of vehicles:","codetypes":[{"id":"curl","text":"curl -i -X POST https://api.nfleet.fi/users/1/problems/6/vehicles/import \r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\"\r\n -d '{\r\n \"Items\":[\r\n {\r\n \"Info\":\"\",\r\n \"Name\":\"Vehicle1\",\r\n \"StartLocation\": {\r\n \"Address\":null,\r\n \"Coordinate\": {\r\n \"Latitude\":62.244588,\r\n \"Longitude\":25.742683,\r\n \"System\":\"WGS84\"\r\n }\r\n },\r\n \"EndLocation\":{\r\n \"Address\":null,\r\n \"Coordinate\": {\r\n \"Latitude\":62.244588,\r\n \"Longitude\":25.742683,\r\n \"System\":\"WGS84\"\r\n }\r\n },\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":300\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n \"Date(1245398693390)\"\r\n ]\r\n },\r\n {\r\n \"Info\":\"\",\r\n \"Name\":\"Vehicle2\",\r\n \"StartLocation\": {\r\n \"Address\":null,\r\n \"Coordinate\": {\r\n \"Latitude\":62.244588,\r\n \"Longitude\":25.742683,\r\n \"System\":\"WGS84\"\r\n }\r\n },\r\n \"EndLocation\":{\r\n \"Address\":null,\r\n \"Coordinate\": {\r\n \"Latitude\":62.244588,\r\n \"Longitude\":25.742683,\r\n \"System\":\"WGS84\"\r\n }\r\n },\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":300\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n \"Date(1245398693390)\"\r\n ]\r\n },\r\n {\r\n \"Info\":\"\",\r\n \"Name\":\"Vehicle3\",\r\n \"StartLocation\": {\r\n \"Address\":null,\r\n \"Coordinate\": {\r\n \"Latitude\":62.244588,\r\n \"Longitude\":25.742683,\r\n \"System\":\"WGS84\"\r\n }\r\n },\r\n \"EndLocation\":{\r\n \"Address\":null,\r\n \"Coordinate\": {\r\n \"Latitude\":62.244588,\r\n \"Longitude\":25.742683,\r\n \"System\":\"WGS84\"\r\n }\r\n },\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":300\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n \"Date(1245398693390)\"\r\n ]\r\n }\r\n ]\r\n }'"},{"id":"cs","text":"var importRequest = new VehicleSetImportRequest\r\n{\r\n Items = new List()\r\n};\r\nfor (int i = 0; i < 10; i++)\r\n{\r\n var veh = new VehicleUpdateRequest()\r\n {\r\n Name = \"Vehicle name\",\r\n Capacities = vehicleCapacities,\r\n StartLocation = vehiclePickup,\r\n EndLocation = vehicleDelivery,\r\n TimeWindows = vehicleTimeWindow\r\n };\r\n importRequest.Items.Add(veh);\r\n}\r\nvar result = api.Navigate(problem.GetLink(\"import-vehicles\"), importRequest);\r\n\r\n"},{"id":"java","text":"VehicleSetImportRequest set = new VehicleSetImportRequest();\r\nList vehicles = new ArrayList();\r\nfor (int i = 0; i < 10; i++) {\r\n\tVehicleUpdateRequest vehicle = new VehicleUpdateRequest(\"vehicle\" + i, list, start, end);\r\n\tvehicles.add(vehicle);\r\n}\r\nset.setItems(vehicles);\r\nResponseData result = api.navigate(ResponseData.class, problem.getLink(\"import-vehicles\"), set);"}]}, {"id":"importvehiclesetresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 201 Created \r\nContent-Type: application/json \r\nContent-Length: 0 \r\nLocation: https://api.nfleet.fi/users/1/problems/6/vehicles"}]}, ] }, { title: 'Routes', id: 'routes', codetitle: 'Accessing vehicle route data', paragraphs: [ { text: "Vehicle route can be accessed through two resources. First option is to refer to the task event sequence of the vehicle, which returns the task events and their state on the route. The other option is to refer to the task event id sequence, which can be used to define and update the vehicle routes.", }, { title: "Task Event Ids object", text: "Task event ids can be accessed as a list of integers.", tables: [{ rows: [ { name: "Items", type: "integer list", description: "The list of task event ids on the route of the vehicle.", optional: false }, { name: "Meta", type: "Link list", description: "List of hypertext links in this resource.", readonly: true }, ] }] }, { title: "RouteEvent Data", text: "Route event object represents the calculated properties of the task event that has been inserted on a route.", tables: [{ rows: [ { name: "Meta", type: "Link list", description: "List of hypertext links in this resource.", readonly: true }, { name: "ArrivalTime", type: "date-time", description: "The point in time on which this task event was arrived to due to explicitly stated changes on the route.", optional: true }, { name: "DepartureTime", type: "date-time", description: "The point in time on which this task event was departed from due to explicitly stated changes on the route.", optional: true }, { name: "State", type: "enum", description: "State of this task event: Unlocked or Locked from optimization.", readonly: true }, { name: "WaitingTimeBefore", type: "double", description: "The waiting time upon arrival before the time window opens.", readonly: true }, { name: "DataState", type: "enum", description: "The need to recalculate the arrival times before using the data. Value can be: Pending or Ready", readonly: true }, { name: "TaskEventId", type: "integer", description: "Identifier that can be used to map route event into corresponding task event.", readonly: true }, { name: "FeasibilityState", type: "enum", description: "Indicates whether or not the route event is able to fulfill its preconditions. Value can be: Feasible or Infeasible", readonly: true }, { name: "KPIs", type: "KPI data", description: "A set of key performance indicators.", readonly: true }, ] }], notes: [{ text: "The PlannedArrivalTime and PlannedDepartureTime are not mutually optional. The vehicle pickup will not contain a planned arrival time as the departure is the beginning of the route. Similarly, the vehicle delivery will not contain a planned departure time as it represents the end of the route. For all the task events in between these two points both the planned arrival time and departure time are mandatory fields."}], }, { title: "Plan Data", text: "Plan object represents a collection task event objects grouped by vehicles. That is essentially a collection of all task event objects of some routing problem.", tables: [{ rows: [ { name: "Meta", type: "Link list", description: "List of hypertext links in this resource.", readonly: true }, { name: "Items", type: "FieldsItem list", description: "A collection of fields item objects.", readonly: true }, { name: "KPIs", type: "KPI data", description: "A set of key performance indicators.", readonly: true }, ] }], }, { title: "Fields Item", text: "Fields Item object represents a collection task event objects grouped by vehicles. That is essentially a collection of all task event objects of some routing problem.", tables: [{ rows: [ { name: "Name", type: "string", description: "Human-readable name of the vehicle.", readonly: true }, { name: "Uri", type: "string", description: "The URI of the subresource.", readonly: true }, { name: "Events", type: "RouteEvent list", description: "List of route event objects.", readonly: true }, ] }], }, ], codeparagraphs: [{"id":"accessingtaskseq","description":"Accessing the task event sequence of a vehicle:","codetypes":[{"id":"curl","text":"curl -i -X GET https://api.nfleet.fi/users/1/problems/6/vehicles/4/events \r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\" "},{"id":"cs","text":"var taskEvents = api.Navigate( vehicle.GetLink( \"list-events\" ) );"},{"id":"java","text":"RouteEventDataSet events = api.navigate(RouteEventDataSet.class, vehicle.getLink(\"list-events\"));"}]}, {"id":"accessingtaskseqresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 200 OK \r\nContent-Type: application/vnd.jyu.nfleet.taskset+json;version=2.0\r\n{\r\n \"Items\":[\r\n {\r\n \"Id\":32001,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":null,\r\n \"Capacities\":[\r\n ],\r\n \"TimeWindows\":[\r\n ],\r\n \"Location\":null,\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n },\r\n {\r\n \"Id\":11,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":null,\r\n \"Capacities\":[\r\n ],\r\n \"TimeWindows\":[\r\n ],\r\n \"Location\":null,\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n },\r\n {\r\n \"Id\":12,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":null,\r\n \"Capacities\":[\r\n ],\r\n \"TimeWindows\":[\r\n ],\r\n \"Location\":null,\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n },\r\n {\r\n \"Id\":16001,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":null,\r\n \"Capacities\":[\r\n ],\r\n \"TimeWindows\":[\r\n ],\r\n \"Location\":null,\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n }\r\n ],\r\n \"Meta\":[\r\n ]\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"}]}, {"id":"accessingroute","description":"Accessing the route of a vehicle:","codetypes":[{"id":"curl","text":"curl -i -X GET https://api.nfleet.fi/users/1/problems/6/vehicles/4/route \r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\" "},{"id":"cs","text":"var route = api.Navigate( vehicle.GetLink( \"get-route\" ) );"},{"id":"java","text":"RouteData routeData = api.navigate(RouteData.class, vehicle.getLink(\"get-route\"));"}]}, {"id":"accessingrouteresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 200 OK \r\nContent-Type: application/vnd.jyu.nfleet.route+json;version=2.0\r\n{\r\n \"Items\":[\r\n 11,\r\n 12\r\n ],\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"/users/1/problems/8/vehicles/1/route\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":false,\r\n \"Type\":\"application/vnd.jyu.nfleet.route+json;version=2.0\"\r\n }\r\n ]\r\n}"}]}, {"id":"updatingroute","description":"Updating a route of a vehicle:","codetypes":[{"id":"curl","text":"curl -i -X PUT https://api.nfleet.fi/users/1/problems/6/vehicles/4/route \r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\"\r\n -H \"If-None-Match: 2\" \r\n -d '{ \"Items\": [ 11, 12 ] }' "},{"id":"cs","text":"api.Navigate(vehicle.GetLink(\"get-route\"));\r\nvar routeReq = new RouteUpdateRequest\r\n{\r\n Items = new[] { 11, 21, 12, 22 }\r\n};\r\napi.Navigate( vehicle.GetLink( \"set-route\" ), routeReq );"},{"id":"java","text":"RouteData routes = api.navigate(RouteData.class, vehicle.getLink(\"get-route\"));\r\nRouteUpdateRequest route = new RouteUpdateRequest();\r\nint[] sequence = {11 , 12, 21, 22};\t\t\r\nroute.setSequence(sequence);\r\nResponseData asdf = api.navigate(ResponseData.class, vehicle.getLink(\"set-route\"), route);"}]}, {"id":"updatingrouteresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 303 See Other\r\nLocation: https://api.nfleet.fi/users/1/problems/6/vehicles/4/route"}]}, {"id":"queryrouteevents","description":"Accessing plan data:","codetypes":[{"id":"curl","text":"curl -i -X GET https://api.nfleet.fi/users/1/problems/6/plan \r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\""},{"id":"cs","text":"var plan = api.Navigate(problem.GetLink(\"plan\"));"},{"id":"java","text":"PlanData plan = api.navigate(PlanData.class, problem.getLink(\"plan\"));"}]}, {"id":"queryrouteeventsresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 200 OK\r\nContent-Type: application/vnd.jyu.nfleet.plan+json;version=2.0 \r\n{\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"/users/1/problems/1/plan\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.plan+json;version=2.0\"\r\n }\r\n ],\r\n \"Items\":[\r\n {\r\n \"Name\":\"test\",\r\n \"Uri\":\"\",\r\n \"Events\":[\r\n {\r\n \"State\":\"Unlocked\",\r\n \"LockState\":\"None\",\r\n \"TimeState\":\"None\",\r\n \"Pending\":false,\r\n \"WaitingTimeBefore\":0.0,\r\n \"ActualArrivalTime\":null,\r\n \"ActualDepartureTime\":null,\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"/users/1/problems/1/vehicles/1/events/1\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.routeevent+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"set-arrival\",\r\n \"Method\":\"PUT\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.routeevent+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"reset-arrival\",\r\n \"Method\":\"PUT\",\r\n \"Enabled\":false,\r\n \"Type\":\"application/vnd.jyu.nfleet.routeevent+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"lock\",\r\n \"Method\":\"PUT\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.routeevent+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"unlock\",\r\n \"Method\":\"PUT\",\r\n \"Enabled\":false,\r\n \"Type\":\"application/vnd.jyu.nfleet.routeevent+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"../../\",\r\n \"Rel\":\"get-vehicle\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicle+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"../../../../tasks/0\",\r\n \"Rel\":\"get-task\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":false,\r\n \"Type\":\"application/vnd.jyu.nfleet.task+json;version=2.0\"\r\n }\r\n ],\r\n \"DataState\":\"Pending\",\r\n \"IsFeasible\":false,\r\n \"VehicleId\":1,\r\n \"TaskEventId\":32001,\r\n \"SequenceNumber\":1,\r\n \"ActualServiceTime\":0.0,\r\n \"TravelTimeBefore\":0.0,\r\n \"InternalState\":\"Unlocked\"\r\n },\r\n {\r\n \"State\":\"Unlocked\",\r\n \"LockState\":\"None\",\r\n \"TimeState\":\"None\",\r\n \"Pending\":false,\r\n \"WaitingTimeBefore\":0.0,\r\n \"ActualArrivalTime\":null,\r\n \"ActualDepartureTime\":null,\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"/users/1/problems/1/vehicles/1/events/2\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.routeevent+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"set-arrival\",\r\n \"Method\":\"PUT\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.routeevent+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"reset-arrival\",\r\n \"Method\":\"PUT\",\r\n \"Enabled\":false,\r\n \"Type\":\"application/vnd.jyu.nfleet.routeevent+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"lock\",\r\n \"Method\":\"PUT\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.routeevent+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"\",\r\n \"Rel\":\"unlock\",\r\n \"Method\":\"PUT\",\r\n \"Enabled\":false,\r\n \"Type\":\"application/vnd.jyu.nfleet.routeevent+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"../../\",\r\n \"Rel\":\"get-vehicle\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.vehicle+json;version=2.0\"\r\n },\r\n {\r\n \"Uri\":\"../../../../tasks/0\",\r\n \"Rel\":\"get-task\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":false,\r\n \"Type\":\"application/vnd.jyu.nfleet.task+json;version=2.0\"\r\n }\r\n ],\r\n \"DataState\":\"Pending\",\r\n \"IsFeasible\":false,\r\n \"VehicleId\":1,\r\n \"TaskEventId\":16001,\r\n \"SequenceNumber\":2,\r\n \"ActualServiceTime\":0.0,\r\n \"TravelTimeBefore\":0.0,\r\n \"InternalState\":\"Unlocked\"\r\n }\r\n ]\r\n }\r\n ]\r\n}"}]}, ] }, { title: 'Import', id: 'import', codetitle: 'Importing vehicles and tasks', paragraphs: [ { text: "Vehicles and tasks can be imported in order to check if data contains any errors. Import result includes a list of errors for each vehicle and task.", }, { title: "Import Data", text: "Route event object represents the calculated properties of the task event that has been inserted on a route.", tables: [{ rows: [ { name: "Meta", type: "Link list", description: "List of hypertext links in this resource.", readonly: true }, { name: "ErrorCount", type: "int", description: "The point in time on which this task event was departed from due to explicitly stated changes on the route.", optional: true }, { name: "State", type: "enum", description: "State of the import: Success or Fail.", readonly: true }, { name: "Vehicles", type: "VehicleError list", description: "List of VehicleError objects.", readonly: true }, { name: "Tasks", type: "TaskError list", description: "List of TaskError objects.", readonly: true }, ] }], }, { title: "VehicleError", text: "VehicleError object is a data structure that includes Vehicle data object and a list of errors.", tables: [{ rows: [ { name: "Vehicle", type: "VehicleData", description: "Vehicle object represents an entity which can perform tasks in sequence.", readonly: true }, { name: "Errors", type: "ErrorData list", description: "List of ErrorData objects.", readonly: true }, ] }], }, { title: "TaskError", text: "TaskError object is a data structure that includes Task data object and a list of errors.", tables: [{ rows: [ { name: "Tasks", type: "TaskData", description: "Task object represents a single task which needs to be performed by a single vehicle.", readonly: true }, { name: "Errors", type: "ErrorData list", description: "List of ErrorData objects.", readonly: true }, ] }], }, ], codeparagraphs: [{"id":"importtasksandvehicles","description":"Importing vehicles and tasks:","codetypes":[{"id":"curl","text":"curl -i -X POST https://api.nfleet.fi/users/1/problems/6/imports \r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\"\r\n -d '{\r\n \"Vehicles\":{\r\n \"Items\":[\r\n {\r\n \"VehicleId\":0,\r\n \"Info\":null,\r\n \"State\":null,\r\n \"Name\":\"Vehicle0\",\r\n \"StartLocation\":{\r\n \"Id\":0,\r\n \"Coordinate\":{\r\n \"Latitude\":62.244958,\r\n \"Longitude\":25.747143,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"EndLocation\":{\r\n \"Id\":0,\r\n \"Coordinate\":{\r\n \"Latitude\":62.244958,\r\n \"Longitude\":25.747143,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":5000\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00\",\r\n \"End\":\"2013-05-14T12:00:00\"\r\n }\r\n ]\r\n },\r\n {\r\n \"VehicleId\":0,\r\n \"Info\":null,\r\n \"State\":null,\r\n \"Name\":\"Vehicle1\",\r\n \"StartLocation\":{\r\n \"Id\":0,\r\n \"Coordinate\":{\r\n \"Latitude\":62.244958,\r\n \"Longitude\":25.747143,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"EndLocation\":{\r\n \"Id\":0,\r\n \"Coordinate\":{\r\n \"Latitude\":62.244958,\r\n \"Longitude\":25.747143,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":5000\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00\",\r\n \"End\":\"2013-05-14T12:00:00\"\r\n }\r\n ]\r\n }\r\n ]\r\n },\r\n \"Tasks\":{\r\n \"Items\":[\r\n {\r\n \"UserId\":0,\r\n \"ProblemId\":0,\r\n \"TaskId\":0,\r\n \"Name\":\"Task0\",\r\n \"Info\":null,\r\n \"TaskEvents\":[\r\n {\r\n \"TaskEventId\":0,\r\n \"Type\":\"Pickup\",\r\n \"Location\":{\r\n \"Id\":0,\r\n \"Coordinate\":{\r\n \"Latitude\":62.282617,\r\n \"Longitude\":25.797272,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00\",\r\n \"End\":\"2013-05-14T12:00:00\"\r\n }\r\n ],\r\n \"ServiceTime\":0.0\r\n },\r\n {\r\n \"TaskEventId\":0,\r\n \"Type\":\"Delivery\",\r\n \"Location\":{\r\n \"Id\":0,\r\n \"Coordinate\":{\r\n \"Latitude\":62.373658,\r\n \"Longitude\":25.885506,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00\",\r\n \"End\":\"2013-05-14T12:00:00\"\r\n }\r\n ],\r\n \"ServiceTime\":0.0\r\n }\r\n ]\r\n },\r\n {\r\n \"UserId\":0,\r\n \"ProblemId\":0,\r\n \"TaskId\":0,\r\n \"Name\":\"Task1\",\r\n \"Info\":null,\r\n \"TaskEvents\":[\r\n {\r\n \"TaskEventId\":0,\r\n \"Type\":\"Pickup\",\r\n \"Location\":{\r\n \"Id\":0,\r\n \"Coordinate\":{\r\n \"Latitude\":62.282617,\r\n \"Longitude\":25.797272,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00\",\r\n \"End\":\"2013-05-14T12:00:00\"\r\n }\r\n ],\r\n \"ServiceTime\":0.0\r\n },\r\n {\r\n \"TaskEventId\":0,\r\n \"Type\":\"Delivery\",\r\n \"Location\":{\r\n \"Id\":0,\r\n \"Coordinate\":{\r\n \"Latitude\":62.373658,\r\n \"Longitude\":25.885506,\r\n \"System\":\"Euclidian\"\r\n },\r\n \"Address\":null\r\n },\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00\",\r\n \"End\":\"2013-05-14T12:00:00\"\r\n }\r\n ],\r\n \"ServiceTime\":0.0\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n }'"},{"id":"cs","text":"var request = new ImportRequest\r\n {\r\n Tasks = taskSet,\r\n Vehicles = vehicleSet\r\n };\r\nvar result = api.Navigate(problem.GetLink(\"import-data\"), request);"},{"id":"java","text":"ImportRequest importRequest = new ImportRequest();\r\nimportRequest.setVehicles(vehicles);\r\nimportRequest.setTasks(tasks);\r\n\t\r\n\tResponseData response = api.navigate(ResponseData.class, problem.getLink(\"import-data\"), importRequest);\r\n\tSystem.out.println(response.getLocation());\r\n\tImportData result = api.navigate(ImportData.class, response.getLocation());"}]}, {"id":"importtasksandvehiclesresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 201 Created \r\nContent-Type: application/json \r\nContent-Length: 0 \r\nLocation: https://api.nfleet.fi/users/1/problems/6/imports/1"}]}, {"id":"getimportresults","description":"Accessing import results:","codetypes":[{"id":"curl","text":"curl -i -X GET https://api.nfleet.fi/users/1/problems/6/imports/1\r\n -H \"Accept: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\""},{"id":"cs","text":"var import = api.Navigate(result.Location);"}]}, {"id":"getimportresultsresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 200 OK\r\nContent-Type: application/vnd.jyu.nfleet.import+json;version=2.0\r\n{\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"/users/1/problems/2/imports/1\",\r\n \"Rel\":\"self\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":\"application/vnd.jyu.nfleet.import+json;version=2.0\"\r\n }\r\n ],\r\n \"ErrorCount\":0,\r\n \"State\":\"Success\",\r\n \"Vehicles\":[\r\n {\r\n \"Vehicle\":{\r\n \"Id\":1,\r\n \"Name\":\"Vehicle0\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":5000\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"StartLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"EndLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"Meta\":[\r\n ],\r\n \"State\":\"Active\"\r\n },\r\n \"Errors\":null\r\n },\r\n {\r\n \"Vehicle\":{\r\n \"Id\":1,\r\n \"Name\":\"Vehicle1\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":5000\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"StartLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"EndLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"Meta\":[\r\n ],\r\n \"State\":\"Active\"\r\n },\r\n \"Errors\":null\r\n },\r\n {\r\n \"Vehicle\":{\r\n \"Id\":1,\r\n \"Name\":\"Vehicle2\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":5000\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"StartLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"EndLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"Meta\":[\r\n ],\r\n \"State\":\"Active\"\r\n },\r\n \"Errors\":null\r\n },\r\n {\r\n \"Vehicle\":{\r\n \"Id\":1,\r\n \"Name\":\"Vehicle3\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":5000\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"StartLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"EndLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"Meta\":[\r\n ],\r\n \"State\":\"Active\"\r\n },\r\n \"Errors\":null\r\n },\r\n {\r\n \"Vehicle\":{\r\n \"Id\":1,\r\n \"Name\":\"Vehicle4\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":5000\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"StartLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"EndLocation\":{\r\n \"Id\":1,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"Meta\":[\r\n ],\r\n \"State\":\"Active\"\r\n },\r\n \"Errors\":null\r\n }\r\n ],\r\n \"Tasks\":[\r\n {\r\n \"Task\":{\r\n \"Id\":1,\r\n \"Name\":\"Task1\",\r\n \"Info\":null,\r\n \"TaskEvents\":[\r\n {\r\n \"Id\":11,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":\"Pickup\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"Location\":{\r\n \"Id\":2,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n },\r\n {\r\n \"Id\":12,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":\"Delivery\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"Location\":{\r\n \"Id\":3,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n }\r\n ],\r\n \"Meta\":[\r\n ],\r\n \"State\":\"Active\"\r\n },\r\n \"Errors\":null\r\n },\r\n {\r\n \"Task\":{\r\n \"Id\":1,\r\n \"Name\":\"Task1\",\r\n \"Info\":null,\r\n \"TaskEvents\":[\r\n {\r\n \"Id\":11,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":\"Pickup\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"Location\":{\r\n \"Id\":2,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n },\r\n {\r\n \"Id\":12,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":\"Delivery\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"Location\":{\r\n \"Id\":3,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n }\r\n ],\r\n \"Meta\":[\r\n ],\r\n \"State\":\"Active\"\r\n },\r\n \"Errors\":null\r\n },\r\n {\r\n \"Task\":{\r\n \"Id\":1,\r\n \"Name\":\"Task1\",\r\n \"Info\":null,\r\n \"TaskEvents\":[\r\n {\r\n \"Id\":11,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":\"Pickup\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"Location\":{\r\n \"Id\":2,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n },\r\n {\r\n \"Id\":12,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":\"Delivery\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"Location\":{\r\n \"Id\":3,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n }\r\n ],\r\n \"Meta\":[\r\n ],\r\n \"State\":\"Active\"\r\n },\r\n \"Errors\":null\r\n },\r\n {\r\n \"Task\":{\r\n \"Id\":1,\r\n \"Name\":\"Task1\",\r\n \"Info\":null,\r\n \"TaskEvents\":[\r\n {\r\n \"Id\":11,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":\"Pickup\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"Location\":{\r\n \"Id\":2,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n },\r\n {\r\n \"Id\":12,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":\"Delivery\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"Location\":{\r\n \"Id\":3,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n }\r\n ],\r\n \"Meta\":[\r\n ],\r\n \"State\":\"Active\"\r\n },\r\n \"Errors\":null\r\n },\r\n {\r\n \"Task\":{\r\n \"Id\":1,\r\n \"Name\":\"Task1\",\r\n \"Info\":null,\r\n \"TaskEvents\":[\r\n {\r\n \"Id\":11,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":\"Pickup\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"Location\":{\r\n \"Id\":2,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n },\r\n {\r\n \"Id\":12,\r\n \"Name\":null,\r\n \"Info\":null,\r\n \"Type\":\"Delivery\",\r\n \"Capacities\":[\r\n {\r\n \"Name\":\"Weight\",\r\n \"Amount\":20\r\n }\r\n ],\r\n \"TimeWindows\":[\r\n {\r\n \"Start\":\"2013-05-14T08:00:00+03:00\",\r\n \"End\":\"2013-05-14T12:00:00+03:00\"\r\n }\r\n ],\r\n \"Location\":{\r\n \"Id\":3,\r\n \"Coordinate\":null,\r\n \"Address\":null\r\n },\r\n \"ServiceTime\":0.0,\r\n \"Meta\":[\r\n ]\r\n }\r\n ],\r\n \"Meta\":[\r\n ],\r\n \"State\":\"Active\"\r\n },\r\n \"Errors\":null\r\n }\r\n ]\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"}]}, {"id":"applyimport","description":"Apply import:","codetypes":[{"id":"curl","text":"curl -i -X POST https://api.nfleet.fi/users/1/problems/6/imports/1/apply\r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\""},{"id":"cs","text":"var appyResult = api.Navigate(import.GetLink(\"apply-import\"));"},{"id":"java","text":"ResponseData response = api.navigate(ResponseData.class, data.getLink(\"apply-import\"));"}]}, {"id":"applyimportresponse","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 201 Created \r\nContent-Type: application/json \r\nContent-Length: 0 \r\nLocation: https://api.nfleet.fi/users/1/problems/6"}]}, ] }, { title: 'Common Data Objects', id: 'datatransferobjects', paragraphs: [ { text: "The following data objects are used in accessing several different resources." }, { title: "Capacity Data", text: "Capacity object represents a named capacity type of a vehicle or a task.", tables: [{ rows: [ { name: "Name", type: "string", description: "Name of the capacity type.", required: true }, { name: "Amount", type: "integer", description: "The amount defined for this capacity.", required: true }, ] }] }, { title: "TimeWindow Data", text: "Time window object represents a time span in between two points in time.", tables: [{ rows: [ { name: "Start", type: "date-time", description: "Start time of the time window.", required: true }, { name: "End", type: "date-time", description: "End time of the time window.", required: true }, ] }] }, { title: "Location Data", text: "Location object represents a location in the routing problem. Location can be defined by address or by coordinates. Alternatively, id can be used to refer to existing location in the problem.", notes: [{ text: "The properties are not mutually optional. At least one of the properties must be given. If the address parameter is given, the coordinates will be sought using that data. However, if coordinate data is given and it contradicts the address data, the coordinates are used."}], tables: [{ rows: [ { name: "Id", type: "integer", description: "Id of this location.", optional: true }, { name: "Coordinate", type: "Coordinate", description: "Coordinates of this location.", optional: true }, { name: "Address", type: "Address", description: "The address of this location", optional: true } ] }] }, { title: "Coordinate Data", text: "Coordinate object represents a pair of coordinates using a given standard.", tables: [{ rows: [ { name: "Latitude", type: "decimal", description: "Latitude component of this coordinate.", required: true }, { name: "Longitude", type: "decimal", description: "Longitude component of this coordinate.", required: true }, { name: "System", type: "enum", description: "The standard system of this coordinate: currently only WGS84 is supported.", required: true } ] }] }, { title: "Address Data", text: "Address object represents a street address of a location.", tables: [{ rows: [ { name: "Country", type: "string", description: "The name of the country for this address.", required: true }, { name: "City", type: "string", description: "The name of the city for this address.", required: true }, { name: "StreetAddress", type: "string", description: "The street name, house and apartment number for this address.", required: true }, { name: "PostalCode", type: "string", description: "Postal code for this address.", optional: true }, ] }] }, { title: "KPI Data", text: "KPI objects represents a set of performance indicators.", tables: [{ rows: [ { name: "AccumulatedTravelTimeWithCargo", type: "decimal", description: "Accumulated travel time with cargo.", readonly: true }, { name: "AccumulatedTravelTimeEmpty", type: "decimal", description: "Accumulated travel time without cargo.", readonly: true }, { name: "AccumulatedLoadingTime", type: "decimal", description: "Accumulated loading time.", readonly: true }, { name: "AccumulatedWaitingTime", type: "decimal", description: "Accumulated waiting time.", readonly: true }, { name: "AccumulatedWorkingTime", type: "decimal", description: "Accumulated working time.", readonly: true }, { name: "AccumulatedTravelDistance", type: "decimal", description: "Accumulated travel distance.", readonly: true }, { name: "AccumulatedPickups", type: "decimal", description: "Accumulated pickups.", readonly: true }, { name: "AccumulatedDeliveries", type: "decimal", description: "Accumulated deliveries.", readonly: true }, { name: "LoadPercentage", type: "decimal", description: "Load percentage.", readonly: true }, { name: "HighestLoadPercentage", type: "decimal", description: "Highest load percentage.", readonly: true }, { name: "TravelTimeWithCargoPercentage", type: "decimal", description: "Travel time with cargo as percentage.", readonly: true }, { name: "TravelTimeEmptyPercentage", type: "decimal", description: "Travel time without cargo as percentage.", readonly: true }, { name: "LoadingTimePercentage", type: "decimal", description: "Loading time as percentage.", readonly: true }, { name: "WaitingTimePercentage", type: "decimal", description: "Waiting time as percentage.", readonly: true }, ] }] } ] }, { title: 'Errors', codetitle: 'Response to bad request', id: 'errordataobjects', paragraphs: [ { text: "Errors in requests are indicated using a list error data objects." }, { title: "Error Data", text: "An error data object indicates a single error.", tables: [{ rows: [ { name: "Code", type: "string", description: "Error code of the error indicated by this error data object.", readonly: true }, { name: "Message", type: "string", description: "A human-readable error message of the error indicated by this error data object.", readonly: true }, { name: "Meta", type: "Link list", description: "List of hypertext links in this resource.", readonly: true }, ] }] }, ], codeparagraphs: [{"id":"badrequest","description":"Sending a bad request.","codetypes":[{"id":"curl","text":"curl -X POST https://api.nfleet.fi/users/1/problems \r\n -H \"Content-Type: application/json\" \r\n -H \"Authorization: Bearer TOKEN_HERE\" \r\n -d '{}' "},{"id":"cs","text":"var problemData = new ProblemData(); \r\nvar result = api.Navigate(problems.GetLink(\"create\"), problemData); "},{"id":"java","text":"ResponseData result = api.navigate(ResponseData.class, user.getLink(\"create-problem\"), problem);\r\nSystem.out.println(result);"}]}, {"id":"badrequestresp","description":"Sample response:","codetypes":[{"id":"any","text":"HTTP/1.1 400 Bad Request\r\nContent-Type: application/vnd.jyu.nfleet.error+json;version=2.0\r\n{\r\n \"Items\":[\r\n {\r\n \"Code\":\"3401\",\r\n \"Message\":\"Routing problem name is missing.\",\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"https://dev.nfleet.fi/help/#3401\",\r\n \"Rel\":\"help\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":null\r\n }\r\n ]\r\n }\r\n ],\r\n \"Meta\":[\r\n {\r\n \"Uri\":\"https://dev.nfleet.fi/help/#400\",\r\n \"Rel\":\"help\",\r\n \"Method\":\"GET\",\r\n \"Enabled\":true,\r\n \"Type\":null\r\n }\r\n ]\r\n}"}]}, ] }, { title: 'HTTP Status Codes', id: 'httpstatuscodes', paragraphs: [ { text: "The following HTTP status codes are used in the system and their semantics follow that of the HTTP 1.1 specification as closely as possible." }, { title: "200 OK", text: "Indicates a successful HTTP request. When received as a response to a GET request, the response contains the entity corresponding to the requested resource.", }, { title: "201 Created", text: " Indicates that the request has been fulfilled and a new resource has been created. When received as a response to a POST request, the response contains the location of the newly created resource in the Location header.", }, { title: "204 No Content", text: "Indicates that the server successfully processed the request, but is not returning any content. Successful DELETE requests are confirmed with this response.", }, { title: "303 See Other", text: "Indicates that the response to the request can be found under another URI using a separate GET request. When received in response to a POST or PUT, the response indicates that the server has received the data and the GET should be performed to the URI indicated by the Location header.", }, { title: "304 Not Modified", text: "Indicates that the resource requested has not been modified since the version specified by the request header If-None-Match, and there is no need to resend the resource, as the client has an up-to-date copy.", }, { title: "400 Bad Request", text: "Indicates that the request cannot be fulfilled due to malformed message or the client tried to do something that was not a valid request in the current state of the system or resource. Additional details on how to correct the request are included in the payload of the message.", }, { title: "401 Unauthorized", text: "Indicates that authentication is required and has failed or has not yet been provided. The WWW-Authenticate header indicates the authentication method used, and the Location header indicates the address to use in authentication.", }, { title: "402 Payment Required", text: "Indicates that the user performing the request has not performed the necessary payment for accessing the resource.", }, { title: "404 Not Found", text: "Indicates that the requested resource could not be found.", }, { title: "405 Method Not Allowed", text: "Indicates that the request cannot be performed for the target resource in its current state.", }, { title: "406 Not Acceptable", text: "Indicates that the server cannot respond in the requested format based on the Accept header.", }, { title: "412 Precondition Failed", text: "Indicates that the requested modification to a resource cannot be performed as the version of the resource indicated by the If-None-Match header does not match. This is usually due to simultaneous modification of the resource by another client.", }, { title: "415 Unsupported Media Type", text: "Indicates that the entity sent in a request (content in a POST or PUT) has an unsupported media type indicated by the Content-Type header.", }, { title: "428 Precondition Required", text: "Indicates that the request must be conditional using the If-None-Match header to prevent data loss due to possible simultaneous updates.", }, { title: "500 Internal Server Error", text: "Indicates a server error which should be temporary. The client may re-send the request as is. If the problem persists, the client is adviced to contact the service provider.", }, { title: "501 Not Implemented", text: "Indicates that the server does not yet have the capability to fulfill the request. The client should contact the service provider to obtain the implementation status.", }, { title: "503 Service Unavailable", text: "Indicates that the server is not currently available, but should be in the future. The client should contact the service provider to obtain information on the nature and length of the unavailability.", }, ], } ] } ];