Example with all allowed parameters
<?php
$url = 'https://pos.cloudware.pt/ws/v1.1/kitchens/12345/printer/';
$apiKey = 'c433ff57a5ba6cdf301a48c97d9432594e35e73ce545945639bc4fb5798f1e8a';
$method = 'POST';
$params = array(
'status' => 1,
'printer' => 'EPSON L3160',
'ip' => '192.168.0.1',
'port' => '90000',
'data' => '{}',
);
$content = json_encode($params);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, $apiKey);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_HTTPHEADER,
array(
"Content-type: application/json",
"Content-Length: " . strlen($content),
)
);
$result = curl_exec($curl);
?>
Request
Name | Type | Example | Description |
---|
status | int | 1 | Status |
printer | string | EPSON L3160 | Printer |
ip | string | 192.168.0.1 | IP |
port | string | 90000 | Port |
data | immutable | {} | Printer Data |
Response
Name | Type | Example | Description |
---|
id | int | 12345 | ID |
kitchen_id | int | 12345 | Kitchen ID |
status | int | 1 | Status |
printer | string | EPSON L3160 | ID |
ip | string | 192.168.0.1 | ID |
port | string | 90000 | Port |
data | string | {} | ID |