Vi tillhandahåller ett REST-baserat API som du kan använda för att hämta öppna data från oss.
Nedan följer instruktioner om hur du interagerar med vårt API.
| Beskrivning | Returnerar en lista på Hack ABs tjänster |
| Metod | GET |
| Autentisering | Ingen |
| Exempel |
GET http://api.hackab.se:8008/services
{
"items": [
"bast",
"battre",
"bra"
],
"_meta": {
"msg": null,
"total": 3,
"auth": null
}
}
|
| Beskrivning | Returnerar information om en specifik tjänst |
| Metod | GET |
| Autentisering | Ingen |
| Exempel |
GET http://api.hackab.se:8008/services/bast
{
"items": {
"available": true,
"link": "http://www.hackab.se/files?id=1",
"description": "Aenean dapibus cursus ligula, in sollicitudin ex luctus vel. [...]
"title": "Bäst"
},
"_meta": {
"msg": null,
"total": 4,
"auth": null
}
}
|
| Beskrivning | Returnerar en lista på Hack ABs medarbetare |
| Metod | GET |
| Autentisering | Gäst |
| Exempel |
GET http://api.hackab.se:8008/employees
{
"items": [
"employee1",
"employee2"
],
"_meta": {
"msg": null,
"total": 2,
"auth": "guest"
}
}
|
| Beskrivning | Returnerar information om en specifik medarbetare |
| Metod | GET |
| Autentisering | Gäst |
| Exempel |
GET http://api.hackab.se:8008/employees/kathleen
{
"items": {
"username": "kathleen@hackab.se",
"fullname": "Kathleen Eriksson",
"uid": "788aaa9041b7a573943488941b0a4a3e",
"title": "VD"
},
"_meta": {
"msg": null,
"total": 4,
"auth": "guest"
}
}
|
| Beskrivning | Returnerar en JSON Web Token för autentisering |
| Metod | POST |
| Autentisering | Ingen |
| Exempel |
POST http://api.hackab.se:8008/login
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.[...]"
}
|
| Beskrivning | Returnerar en lista på implementerade API-anrop |
| Metod | GET |
| Autentisering | Ingen |
| Exempel |
GET http://api.hackab.se:8008/endpoints
{
"items": {
"services": {
"method": "GET",
"auth": false,
"subresource": "service_id"
},
"login": {
"method": "POST",
"auth": false,
"subresource": false
},
"employees": {
"method": "GET",
"auth": "guest",
"subresource": "employee_id"
},
"endpoints": {
"method": "GET",
"auth": false,
"subresource": false
}
},
"_meta": {
"msg": null,
"total": 4,
"auth": null
}
}
|