Assign Machine to Route
curl --request POST \
--url https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"MachineIds": [
123
]
}
'import requests
url = "https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines"
payload = { "MachineIds": [123] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({MachineIds: [123]})
};
fetch('https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MachineIds' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines"
payload := strings.NewReader("{\n \"MachineIds\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"MachineIds\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"MachineIds\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"MachineTypeLutId": 123,
"MachineId": 123,
"MachineName": "<string>",
"MachineNumber": "<string>",
"CountryId": 123,
"City": "<string>",
"Address": "<string>",
"StreetNumber": "<string>",
"Longitude": "<string>",
"Latitude": "<string>",
"InstituteId": 123,
"InstituteName": "<string>",
"LocationId": 123,
"LocationName": "<string>",
"CustomerId": 123,
"CustomerName": "<string>",
"CustomerLocationId": 123,
"CustomerLocationName": "<string>",
"StatusId": 123,
"DriverId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"RouteId": 123,
"UserId": 123,
"CreatedBy": 123,
"CreatedDt": "2023-11-07T05:31:56Z"
}
]Scheduling
Assign Machine to Route
Assigns a machine to a specific route. The request body should include the details of the machine to be assigned.
Assign Machine to Route
curl --request POST \
--url https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"MachineIds": [
123
]
}
'import requests
url = "https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines"
payload = { "MachineIds": [123] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({MachineIds: [123]})
};
fetch('https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MachineIds' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines"
payload := strings.NewReader("{\n \"MachineIds\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"MachineIds\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://qa-lynx.nayax.com/operational/v1/Scheduling/route-machines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"MachineIds\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"MachineTypeLutId": 123,
"MachineId": 123,
"MachineName": "<string>",
"MachineNumber": "<string>",
"CountryId": 123,
"City": "<string>",
"Address": "<string>",
"StreetNumber": "<string>",
"Longitude": "<string>",
"Latitude": "<string>",
"InstituteId": 123,
"InstituteName": "<string>",
"LocationId": 123,
"LocationName": "<string>",
"CustomerId": 123,
"CustomerName": "<string>",
"CustomerLocationId": 123,
"CustomerLocationName": "<string>",
"StatusId": 123,
"DriverId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"RouteId": 123,
"UserId": 123,
"CreatedBy": 123,
"CreatedDt": "2023-11-07T05:31:56Z"
}
]Authorizations
Query Parameters
Body
application/json
Response
200 - application/json
The details of the machine assigned to the route.
Was this page helpful?