API Gestionale ZERO
API Endpoint
https://api.gestionalezero.it/v1Linee guida per l’utilizzo dell’api sviluppatori.
Tutte le richieste vanno effettuate in https sotto autorizzazione di tipo ‘bearer’.
Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1N...
Gli oggetti ritornati seguono la specifica HAL.
Riportare qui tutti gli errori comuni tipo autorizzazione e not found.
Identità e Accesso ¶
Gestione del profilo utente e comproprietario.
Profilo utente ¶
Rappresenta l’utente loggato.
Headers
Content-Type: application/jsonBody
{
"_links": {
"self": {
"href": "/utente"
},
"logs": {
"href": "/utente/logs"
}
},
"id": "google-oauth2|4455363612345229809876",
"nome": "Alex",
"email": "alex@gestionalezero.it",
"immagine": "https://lh4.googleusercontent.com/AAAAAAAAAKc/1123-P65n4w/photo.jpg",
"emailVerificata": true,
"social": false,
"bloccato": false,
"creatoIl": "2018-12-19T14:59:04.429Z",
"ultimoIP": "2.32.8.48",
"ultimoLogin": "2019-01-03T11:17:32.398Z"
}Headers
Content-Type: application/jsonBody
{
"code": 401,
"message": "Unauthorized",
"type": "INVALID_TOKEN"
}RecuperaGET/utente
Restituisce i dati del profilo utente.
Headers
Content-Type: application/jsonBody
{
"nome": "Alex Bra",
"immagine": "https://lh4.googleusercontent.com/AAAAAAAAAKc/1123-P65n4w/photo.jpg"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"nome": {
"type": "string",
"description": "Nome utente"
},
"immagine": {
"type": "string",
"description": "Url dell'immagine di profilo"
}
}
}Headers
Content-Type: application/jsonBody
{
"_links": {
"self": {
"href": "/utente"
}
},
"id": "google-oauth2|4455363612345229809876",
"nome": "Alex Bra",
"immagine": "https://lh4.googleusercontent.com/AAAAAAAAAKc/1123-P65n4w/photo.jpg"
}Headers
Content-Type: application/jsonBody
{
"code": 422,
"message": "Parameters validation error!",
"type": "VALIDATION_ERROR",
"data": [
{
"type": "stringEmpty",
"field": "nome",
"message": "The 'nome' field must not be empty!"
}
]
}AggiornaPATCH/utente
Aggiorna il nome o l’immagine del profilo utente.
I due attributi sono opzionali.
Se il nome viene indicato, va necessariamente valorizzato.
Cambia email utente ¶
Modifica l’email dell’utente loggato.
Headers
Content-Type: application/jsonBody
{
"email": "alex@gestionalezero.it"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"email": {
"type": "string",
"description": "Email utente"
}
},
"required": [
"email"
]
}Headers
Content-Type: application/jsonBody
{
"_links": {
"self": {
"href": "/utente/cambia_email"
},
"utente": {
"href": "/utente"
}
},
"id": "google-oauth2|4455363612345229809876",
"email": "alex@gestionalezero.it",
"email_verificata": "false"
}Headers
Content-Type: application/jsonBody
{
"code": 422,
"message": "Parameters validation error!",
"type": "VALIDATION_ERROR",
"data": [
{
"type": "stringEmpty",
"field": "email",
"message": "The 'email' field must not be empty!"
}
]
}Cambia email utentePUT/utente/cambia_email
Invia email verifica ¶
Invia un email per la verifica dell’utente loggato.
Headers
Content-Type: application/jsonBody
{
"_links": {
"self": {
"href": "/utente/invia_email_verifica"
},
"utente": {
"href": "/utente"
}
},
"id": "google-oauth2|4455363612345229809876",
"email": "alex@gestionalezero.it"
}Invia email verificaPOST/utente/invia_email_verifica
Ticket cambio password ¶
Crea un ticket per effettuare il cambio password.
Headers
Content-Type: application/jsonBody
{
"url_ritorno": "https://app.gestionalezero.it/utente"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"url_ritorno": {
"type": "string",
"description": "Url cui essere reindirizzati dopo l'avvenuto cambio"
}
},
"required": [
"url_ritorno"
]
}Headers
Content-Type: application/jsonBody
{
"_links": {
"self": {
"href": "/utente/ticket_cambio_password"
},
"utente": {
"href": "/utente"
}
},
"id": "google-oauth2|4455363612345229809876",
"ticket": "https://login.gestionalezero.it/lo/reset?ticket=oOBQ9lFFsWvixl3NFBfkHqBAKsw18lmu#"
}Headers
Content-Type: application/jsonBody
{
"code": 403,
"message": "Forbidden",
"type": "INVALID_OPERATION",
"data": {
"message": "Il cambio password di un utente 'social' non è permesso"
}
}Ticket cambio passwordPOST/utente/ticket_cambio_password
L’utente registrato tramite profilo social, non può effettuare il cambio password tramite questa API.
In tal caso il cambio password può avvenire solo tramite Facebook o Google.
Generated by aglio on 03 Jan 2019