At login the API caller receives access, using AccountName and AccountPassword of the login request and the UserName coded into the certification used for the HTTPS channel. The login is valid for the duration of the last valid call +10 minutes. A new AccountPassword generation can be requested on the Administration site. Any API Account might be assigned to the user name based on the access level set by the data master via the administration site. Database settings and Customer data are linked to the API Accounts.
POST /login HTTP/1.1 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { "data": [{ "type": "login", "attributes": { "AccountName": "Agrovir API1", "AccountPassword": "123456", "Language": "hu" } }] }
HTTP/1.1 200 OK Content-Type: application/vnd.api+json { "meta": { "JWToken": "ba1af54ec3f014f765e8172f9a86dc2a" "Language": "hu" }, "links": { "self": "http://api.visiblefarm.net/login" }, "data": [{ "type": "login", "id": "2635", "attributes": { "AccountName": "Agrovir API1", "AccountPassword": "456123", "LastPasswordTime": "2018-07-02T14:56:29.000Z", "PasswordValidTime": "00:10:00.000", "Description": "Agrovir Kft budaörsi teszt alkalmazás", "Address": "Tata", "Contact": "Nagy Dávid", "Mail": "nagy.david@agrovir.hu", "Phone": "+36 30 111 2222", "Database": "http://database.visiblefarm.net:5432" } }] }
HTTP/1.1 403 Forbidden Content-Type: application/vnd.api+json { "errors": [{ "status": "403", "source": { "pointer": "/login" }, "title": "Forbidden", "details": "AccountPassword is not valid!" }] }
or
HTTP/1.1 404 Not found Content-Type: application/vnd.api+json { "errors": [{ "status": "404", "source": { "pointer": "/login" }, "title": "Not found", "details": "The given AccountName does not exists." }] }