{"info":{"_postman_id":"f3496215-4ab6-4d52-8e27-935ea860fe20","name":"eKool public API","description":"<html><head></head><body><p>This documentation explains how to use Ekool API.</p>\n<h3 id=\"variables\"><strong>Variables:</strong></h3>\n<h4 id=\"staging\">Staging:</h4>\n<p>login_url - <a href=\"https://login.ekool.dev\">https://login.ekool.dev</a><br>api_url - <a href=\"https://api-v2.ekool.dev\">https://api-v2.ekool.dev</a></p>\n<h4 id=\"production\">Production:</h4>\n<p>login_url - <a href=\"https://login.ekool.eu\">https://login.ekool.eu</a><br>api_url - <a href=\"https://api-v2.ekool.eu\">https://api-v2.ekool.eu</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"17171853","collectionId":"f3496215-4ab6-4d52-8e27-935ea860fe20","publishedId":"UVsSNPRK","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"489FFE"},"publishDate":"2022-03-23T14:09:20.000Z"},"item":[{"name":"Authorization","item":[{"name":"Client user authorization initialization","id":"ff4ef70d-1cb3-4962-b5eb-86e0910c7932","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{login_url}}/oauth/authorize?client_id&redirect_uri&response_type=code&scope","description":"<p>When making a request, the user's browser will be redirected to the eKool authorization service, where the user must log in and grant the right to access their profile. After successful confirmation, the browser will be redirected to the specified redirect link with the added user authorization code required in step 2.</p>\n","urlObject":{"path":["oauth","authorize"],"host":["{{login_url}}"],"query":[{"description":{"content":"<p>must place the previously granted client application identifier</p>\n","type":"text/plain"},"key":"client_id","value":null},{"description":{"content":"<p>must place the previously granted redirect uri</p>\n","type":"text/plain"},"key":"redirect_uri","value":null},{"description":{"content":"<p>must place “code”</p>\n","type":"text/plain"},"key":"response_type","value":"code"},{"description":{"content":"<p>must place the previously granted client scope, for example, “users-basic”</p>\n","type":"text/plain"},"key":"scope","value":null}],"variable":[]}},"response":[{"id":"88710cae-537f-4b6f-9de4-57df1ecdd132","name":"Success","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{login_url}}/oauth/authorize?client_id&redirect_uri&response_type=code&scope","host":["{{login_url}}"],"path":["oauth","authorize"],"query":[{"key":"client_id","value":null,"description":"must place the previously granted client application identifier"},{"key":"redirect_uri","value":null,"description":"must place the previously granted redirect uri"},{"key":"response_type","value":"code","description":"must place “code”"},{"key":"scope","value":null,"description":"must place the previously granted client scope, for example, “users-basic”"}]}},"status":"Found","code":302,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{redirect_uri}?code={code}"},{"id":"f459a4f2-0645-450b-be46-51954eff9a07","name":"Error","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{login_url}}/oauth/authorize?client_id&redirect_uri&response_type=code&scope","host":["{{login_url}}"],"path":["oauth","authorize"],"query":[{"key":"client_id","value":null,"description":"must place the previously granted client application identifier"},{"key":"redirect_uri","value":null,"description":"must place the previously granted redirect uri"},{"key":"response_type","value":"code","description":"must place “code”"},{"key":"scope","value":null,"description":"must place the previously granted client scope, for example, “users-basic”"}]}},"status":"Found","code":302,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{redirect_uri}?error={error name}&message={error message}&hint={error hint}"}],"_postman_id":"ff4ef70d-1cb3-4962-b5eb-86e0910c7932"},{"name":"Authorization code exchange","id":"60cf0299-8c9f-46d1-91d0-81b4ec0d4e39","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"authorization_code","description":"<p>must place “authorization_code”</p>\n","type":"text"},{"key":"client_id","value":"","description":"<p>must place the previously granted client application identifier</p>\n","type":"text"},{"key":"client_secret","value":"","description":"<p>must place the previously granted client secret</p>\n","type":"text"},{"key":"redirect_uri","value":"","description":"<p>must place the previously granted redirect uri</p>\n","type":"text"},{"key":"code","value":"","description":"<p>must place the “code”, which was obtained in step 1</p>\n","type":"text"}]},"url":"{{login_url}}/oauth/token","description":"<p>After receiving \"access_token\", the user has granted the rights to access his eKool profile information. With this access token, we can access API features using the API authorization.</p>\n<p>If the user's “refresh_token” is valid, it is possible to renew the user's access token without requesting new “code”. This way, the user will not have to log in to the eKool system to be authorized against the app</p>\n","urlObject":{"path":["oauth","token"],"host":["{{login_url}}"],"query":[],"variable":[]}},"response":[{"id":"7d0ed0c8-5a93-4111-8e97-5dbec705a067","name":"Success","originalRequest":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"authorization_code","description":"must place “authorization_code”","type":"text"},{"key":"client_id","value":"","description":"must place the previously granted client application identifier","type":"text"},{"key":"client_secret","value":"","description":"must place the previously granted client secret","type":"text"},{"key":"redirect_uri","value":"","description":"must place the previously granted redirect uri","type":"text"},{"key":"code","value":"","description":"must place the “code”, which was obtained in step 1","type":"text"}]},"url":"{{login_url}}/oauth/token"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\r\n    \"token_type\": \"Bearer\",                         //an access token type, which by the oAuth2 standard is “Bearer”\r\n    \"expires_in\": 604800,                           //token expire time in seconds\r\n    \"access_token\": \"eyJ0eXiJS1A...UzIi7_A\",        // an access token, which is used in API requests, to authorize user\r\n    \"refresh_token\": \"def5020c40f...d20b6a62\"       //an access renewal token, which is used when access token is expired (step 3)\r\n}\r\n"},{"id":"4ce5b43a-4ecb-4cd9-a5df-34f69f1893a7","name":"Error","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/x-www-form-urlencoded","type":"text"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"authorization_code","equals":true,"description":"must place “authorization_code”"},{"key":"client_id","value":"","equals":true,"description":"must place the previously granted client application identifier"},{"key":"client_secret","value":"","equals":true,"description":"must place the previously granted client secret"},{"key":"redirect_uri","value":"","equals":true,"description":"must place the previously granted redirect uri"},{"key":"code","value":"","equals":true,"description":"must place the “code”, which was obtained in step 1"}]},"url":"{{login_url}}/oauth/token"},"status":"Unauthorized","code":401,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\r\n    \"error\": \"...\",\r\n    \"error_description\": \"...\",\r\n    \"hint\": \"...\",\r\n    \"message\": \"...\"\r\n}"}],"_postman_id":"60cf0299-8c9f-46d1-91d0-81b4ec0d4e39"},{"name":"Refresh token","id":"482aef84-45f7-44e2-aab8-02b32eed1dae","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"refresh_token","description":"<p>must place “refresh_token”</p>\n","type":"text"},{"key":"client_id","value":"","description":"<p>must place the previously granted client application identifier</p>\n","type":"text"},{"key":"client_secret","value":"","description":"<p>must place the previously granted client secret</p>\n","type":"text"},{"key":"refresh_token","value":"","description":"<p>must place the “refresh_token”, which was obtained in step 2</p>\n","type":"text"}]},"url":"{{login_url}}/oauth/token","urlObject":{"path":["oauth","token"],"host":["{{login_url}}"],"query":[],"variable":[]}},"response":[{"id":"92bf3d1d-db0d-4674-b9f0-4cf1f6fe59b6","name":"Success","originalRequest":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"refresh_token","description":"must place “refresh_token”","type":"text"},{"key":"client_id","value":"","description":"must place the previously granted client application identifier","type":"text"},{"key":"client_secret","value":"","description":"must place the previously granted client secret","type":"text"},{"key":"refresh_token","value":"","description":"must place the “refresh_token”, which was obtained in step 2","type":"text"}]},"url":"{{login_url}}/oauth/token"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\r\n    \"token_type\": \"Bearer\",                         //an access token type, which by the oAuth2 standard is “Bearer”\r\n    \"expires_in\": 604800,                           //token expire time in seconds\r\n    \"access_token\": \"eyJ0eXiJS1A … UzIi7_A\",        // an access token, which is used in API requests, to authorize user\r\n    \"refresh_token\": \"def5020c40f … d20b6a62\"       //an access renewal token, which is used when access token is expired (step 3)\r\n}\r\n"},{"id":"444032d0-3919-42ff-8624-4c31cb64d1b5","name":"Error","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/x-www-form-urlencoded","type":"text"}],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"refresh_token","description":"must place “refresh_token”","type":"text"},{"key":"client_id","value":"","description":"must place the previously granted client application identifier","type":"text"},{"key":"client_secret","value":"","description":"must place the previously granted client secret","type":"text"},{"key":"refresh_token","value":"","description":"must place the “refresh_token”, which was obtained in step 2","type":"text"}]},"url":"{{login_url}}/oauth/token"},"status":"Unauthorized","code":401,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\r\n    \"error\": \"...\",\r\n    \"error_description\": \"...\",\r\n    \"hint\": \"...\",\r\n    \"message\": \"...\"\r\n}"}],"_postman_id":"482aef84-45f7-44e2-aab8-02b32eed1dae"}],"id":"36e7a1e9-b6a9-4b68-bf4c-b6c9f468c74d","description":"<h4 id=\"acquisition-of-client-oauth-20-access-data\">Acquisition of client oAuth 2.0 access data</h4>\n<p>1. To create a new client, you need to send an email to \"<a href=\"mailto:help@ekool.eu\">help@ekool.eu</a>\" stating:</p>\n<ul>\n<li>the name of the institution or company;</li>\n<li>name, surname, e-mail and telephone number of the responsible person;</li>\n<li>the purpose of authorization usage;</li>\n<li>redirect uri (<em>for example,</em> <a href=\"https://my.application.com/oauth2k/callback\"><em>https://my.application.com/oauth2/callback</em></a> <em>).</em></li>\n</ul>\n<p>2. After receiving the authorization data from the e-mail (client application identifier - <em>client_id</em>, associated password - <em>client_secret</em> and available <em>scopes</em>), you can make requests against the eKool authorization server - {{login_url}}/oauth/ .</p>\n<ul>\n<li>client_id consists of 32 numbers and symbols (for example, <em>“oaD43fvd3aCdf45dDsc428hMuY6T6trG”);</em></li>\n<li>client_secret consists of 40 numbers and symbols (for example, <em>“8yFFEvVq65ukVTWtDVRMjttM5nyRg0ErCBJnRSlb”);</em></li>\n<li>scopes consists of words or a combination of words denoting data access rights (for example, “users-basic”).</li>\n</ul>\n<p><em>Keep the client_id, associated secret, and scopes in a safe place. If you have any questions or problems, please contact</em> <a href=\"mailto:help@ekool.eu\">help@ekool.eu</a><em>. In case of additional rights, for specific needs, contact the support service by the email above.</em></p>\n<h4 id=\"available-scopes\">Available scopes:</h4>\n<ul>\n<li>users-basic<ul>\n<li>{{api_url}}/generaldata</li>\n<li>{{api_url}}/user/me/basic</li>\n</ul>\n</li>\n<li>users-roles<ul>\n<li>{{api_url}}/user/me/roles</li>\n</ul>\n</li>\n<li>users-schools<ul>\n<li>{{api_url}}/user/me/schools</li>\n</ul>\n</li>\n<li>users-children<ul>\n<li>{{api_url}}/user/me/children</li>\n</ul>\n</li>\n</ul>\n","_postman_id":"36e7a1e9-b6a9-4b68-bf4c-b6c9f468c74d"},{"name":"API methods","item":[{"name":"General user data","id":"e863b8d1-2c7e-408b-88e2-a2dba14b2c56","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"","description":"<p>Authorization header must place “access_token” after “Bearer ”</p>\n","type":"text"}],"url":"{{api_url}}/generaldata","urlObject":{"path":["generaldata"],"host":["{{api_url}}"],"query":[],"variable":[]}},"response":[{"id":"e3e478bc-3236-442c-ad8e-1aced4a34547","name":"Success","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"","description":"Authorization header must place “access_token” after “Bearer ”","type":"text"}],"url":"{{api_url}}/generaldata"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\r\n    \"username\": \"...\",\r\n    \"authorities\": [\r\n        {\r\n            \"authority\": \"ROLE_USER\"\r\n        }\r\n    ],\r\n    \"id\": ...,\r\n    \"firstName\": \"...\",\r\n    \"lastName\": \"...\",\r\n    \"idCode\": \"...\",\r\n    \"gender\": 1,\r\n    \"lockedProfile\": false,\r\n    \"active\": null,\r\n    \"idIssuedBy\": {\r\n        \"id\": ...,\r\n        \"name\": \"...\",\r\n        \"isoCode\": \"...\",\r\n        \"countryCode\": null\r\n    },\r\n    \"authenticationType\": null,\r\n    \"accountNonExpired\": true,\r\n    \"accountNonLocked\": true,\r\n    \"credentialsNonExpired\": true,\r\n    \"enabled\": true,\r\n    \"rememberMe\": false,\r\n    \"authenticationData\": null,\r\n    \"harIDRoles\": []\r\n}\r\n"}],"_postman_id":"e863b8d1-2c7e-408b-88e2-a2dba14b2c56"},{"name":"User basic data","id":"1f0b6dfc-cefb-4d0c-ab86-04cc1bc37031","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"","description":"<p>https://{{api_url}}/user/me/basic</p>\n","type":"text"}],"url":"{{api_url}}/user/me/basic","urlObject":{"path":["user","me","basic"],"host":["{{api_url}}"],"query":[],"variable":[]}},"response":[{"id":"0e437729-a04e-4393-ac57-07cb150bbdc6","name":"Success","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"","description":"Authorization header must place “access_token” after “Bearer ”","type":"text"}],"url":"{{api_url}}/user/me/basic"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\r\n    \"status\": true,\r\n    \"meta\": [],\r\n    \"data\": {\r\n        \"id\": \"...\",\r\n        \"first_name\": \"...\",\r\n        \"last_name\": \"...\",\r\n        \"email\": \"...\",\r\n        \"id_code\": \"...\"\r\n    }\r\n}"}],"_postman_id":"1f0b6dfc-cefb-4d0c-ab86-04cc1bc37031"},{"name":"User roles","id":"0893ca65-83f5-46db-9537-6fca32bd0918","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"","description":"<p>Authorization header must place “access_token” after “Bearer ”</p>\n","type":"text"}],"url":"{{api_url}}/user/me/roles","urlObject":{"path":["user","me","roles"],"host":["{{api_url}}"],"query":[],"variable":[]}},"response":[{"id":"5bbb045e-f75a-473c-b9c2-9fc6bb214fcb","name":"Success","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"","description":"Authorization header must place “access_token” after “Bearer ”","type":"text"}],"url":"{{api_url}}/user/me/roles"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\r\n    \"status\": true,\r\n    \"meta\": [],\r\n    \"data\": [\r\n        {\r\n            \"role_id\": \"...\",\r\n            \"type_id\": \"...\",\r\n            \"role_name\": \"...\",\r\n            \"school_id\": \"...\"\r\n        },\r\n        {\r\n            \"role_id\": \"...\",\r\n            \"type_id\": \"...\",\r\n            \"role_name\": \"...\",\r\n            \"school_id\": \"...\"\r\n        }\r\n    ]\r\n}"}],"_postman_id":"0893ca65-83f5-46db-9537-6fca32bd0918"},{"name":"User schools","id":"d79c1f32-3b93-4e85-a7a3-ecf380825ec4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"","description":"<p>Authorization header must place “access_token” after “Bearer ”</p>\n","type":"text"}],"url":"{{api_url}}/user/me/schools","urlObject":{"path":["user","me","schools"],"host":["{{api_url}}"],"query":[],"variable":[]}},"response":[{"id":"24b95ae8-ef0d-4e7b-936d-9f9d33de1d0f","name":"Success","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"","description":"Authorization header must place “access_token” after “Bearer ”","type":"text"}],"url":"{{api_url}}/user/me/schools"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\r\n    \"status\": true,\r\n    \"meta\": [],\r\n    \"data\": [\r\n        {\r\n            \"id\": \"...\",\r\n            \"name\": \"...\",\r\n            \"reg_nr\": \"...\",\r\n            \"ehis_id\": \"...\"\r\n        },\r\n        {\r\n            \"id\": \"...\",\r\n            \"name\": \"...\",\r\n            \"reg_nr\": \"...\",\r\n            \"ehis_id\": \"...\"\r\n        }\r\n    ]\r\n}"}],"_postman_id":"d79c1f32-3b93-4e85-a7a3-ecf380825ec4"},{"name":"User children","id":"2c0bcf40-3c60-4cd7-b1f3-ceb635475110","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"","description":"<p>Authorization header must place “access_token” after “Bearer ”</p>\n","type":"text"}],"url":"{{api_url}}/user/me/children","urlObject":{"path":["user","me","children"],"host":["{{api_url}}"],"query":[],"variable":[]}},"response":[{"id":"6f0d0f07-8d7a-4a29-a0a0-425225e93fa1","name":"Success","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"","description":"Authorization header must place “access_token” after “Bearer ”","type":"text"}],"url":"{{api_url}}/user/me/children"},"status":"OK","code":200,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\r\n    \"status\":true,\r\n    \"meta\":[],\r\n    \"data\": [\r\n        {\r\n            \"user_id\": \"...\",\r\n            \"role_id\": \"...\",\r\n            \"first_name\": \"...\",\r\n            \"last_name\": \"...\",\r\n            \"id_code\": \"...\",\r\n            \"school_id\": \"...\"\r\n        },\r\n        {\r\n            \"user_id\": \"...\",\r\n            \"role_id\": \"...\",\r\n            \"first_name\": \"...\",\r\n            \"last_name\": \"...\",\r\n            \"id_code\": \"...\",\r\n            \"school_id\": \"...\"\r\n        }\r\n    ]\r\n}"}],"_postman_id":"2c0bcf40-3c60-4cd7-b1f3-ceb635475110"}],"id":"4f6576df-75ff-44d4-af6b-69fe48e7a1a1","_postman_id":"4f6576df-75ff-44d4-af6b-69fe48e7a1a1","description":""}]}