The customers are the given agronomists. The specific jobs and devices must be assigned to the customers. Automatic filled attributes:
GET /customer?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/customer" }, "data":[{ "type": "customer", "id": "1", "attributes": { "CustomerName": "Agro Bt.", }, { "type": "customer", "id": "2", "attributes": { "CustomerName": "Mezőgazdasági Kft.", } }] }
HTTP/1.1 400 Bad Request Content-Type: application/vnd.api+json { "meta":{ "JWToken": "ba1af54ec3f014f765e8172f9a86dc2a" }, "errors": [{ "status": "400", "source": { "pointer": "/customer" }, "title": "Bad Request", "details": "User is not authenticated for this function", }] }
HTTP/1.1 403 Forbidden Content-Type: application/vnd.api+json { "meta":{ "JWToken": "ba1af54ec3f014f765e8172f9a86dc2a" }, "errors": [{ "status": "403", "source": { "pointer": "/customer" }, "title": "Forbidden", "details": "The given JSON Web Token (JWT) is invalid!", }] }
GET /customer/1?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/customer/1" }, "data":[{ "type": "customer", "id": "1", "attributes": { "CustomerName": "Agro Bt.", "Description": "bármi", "Address": "Messze", "Contact": "Nagy László", "Mail": "info@agrobt.hu", "Phone": "+36 30 111 2222", } }] }
POST /customer HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { "meta":{ "JWToken": "ba1af54ec3f014f765e8172f9a86dc2a" }, "data":[{ "type": "customer", "attributes": { "CustomerName": "Agro Kft.", } }] }
HTTP/1.1 201 Created Content-Type: application/vnd.api+json { "meta":{ "JWToken": "ba1af54ec3f014f765e8172f9a86dc2a" }, "links": { "self": "http://api.visiblefarm.net/customer" }, "data":[{ "type": "customer", "id": "3", "attributes": { "CustomerName": "Agro Kft.", "Description": "", "Address": "", "Contact": "", "Mail": "", "Phone": "", } }] }
PATCH /customer/1 HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { "meta":{ "JWToken": "ba1af54ec3f014f765e8172f9a86dc2a" }, "data":[{ "type": "customer", "id":" 1", "attributes": { "Description": "Lett egy új comment", } }] }
HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "meta":{ "JWToken": "ba1af54ec3f014f765e8172f9a86dc2a" }, "links": { "self": "http://api.visiblefarm.net/customer/1" }, "data":[{ "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", } }] }