The machines and devices are data sources with their own identifiers, from where measurement data might arrive in the system. The devices must be assigned to the customers. If a new device is detected during data upload, and the customer is unknown, it will be automatically assigned to Unknown customer of the given Account. The unique identifier of the device or machine in communication is the DeviceIndentifier. If this exists and the value is known, it is recommended to provide it for automatic identification. Automatic filled attributes:
GET /device?filter[JWToken]=’ba1af54ec3f014f765e8172f9a’&filter[owner]=1 HTTP/1.1 Accept: application/vnd.api+json
HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "meta":{ "JWToken": "ba1af54ec3f014f765e8172f9a86dc2a" }, "links": { "self": "http://api.visiblefarm.net/device" }, "data":[{ "type": "device", "id": "1702", "attributes": { "DeviceName": "Class - Mega", "DeviceReference": "CLM-001", }, "relationships": { "owner": { "data": { "id": "1", "type": "customer" } }, "devicetype": { "data": { "id": "1", "type": "devicetype" } } } },{ "type":device, "id":"1703", "attributes": { "DeviceName": "Fendt – 718 Vario", "Reference": "FEV-718", }, "relationships": { "owner": { "data": { "id": "1", "type": "customer" } }, "devicetype": { "data": { "id": "2", "type": "devicetype" } }, } },{ "type":device, "id":"253", "attributes": { "DeviceName": "HUNIPER", "Reference": "", }, "relationships": { "owner": { "data": { "id": "1", "type": "customer" } }, "devicetype": { "data": { "id": "6", "type": "devicetype" } }, } },{ "type":device, "id":"319", "attributes": { "DeviceName": "AGRIKON", "Reference": "kicsi piros borona", }, "relationships": { "owner": { "data": { "id": "1", "type": "customer" } }, "devicetype": { "data": { "id": "3", "type": "devicetype" } }, } }] }
GET /device?filter[JWToken]=’ba1af5e8172f9a’&filter[owner]=1&filter[devicetype]=1,2 HTTP/1.1 Accept: application/vnd.api+json
GET /device?filter[JWToken]=’ba1af5e8172f9a’&filter[owner]=1&filter[devicetype]<>1,2 HTTP/1.1 Accept: application/vnd.api+json
GET /device/1703?filter[JWToken]=’ba1af54ec3f014f765e8172f9a86dc2a’ HTTP/1.1 Accept: application/vnd.api+json
HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "meta":{ "JWToken": "ba1af54ec3f014f765e8172f9a86dc2a" }, "links": { "self": "http://api.visiblefarm.net/device/1703" }, "data":[{ "type": "device", "id": "1703", "attributes": { "DeviceName": "Fendt – 718 Vario", "Description": "Nagy zöld", "Reference": "FEV-718", "Protocol_ID": "A0023423060502", }, optional "relationships": { "owner": { "data": { "id": "1", "type": "customer" } }, "devicetype": { "data": { "id": "1", "type": "devicetype" } } } }], "included": [{ "type": "customer", "id": "1", "attributes": { "CustomerName": "Agro Bt.", "Description": "Lett egy új comment", "Address": "Messze", "Contact": "Nagy László", "Mail": "info@agrobt.hu", "Phone": "+36 30 111 2222", },{ "type":devicetype, "id":"1", "attributes": { "DeviceClass": "1", "Description": "Erőgépek", }, }] }