Rest API metodi per gestire gli utenti, tra cui creazione, aggiornamento, elenco, eliminazione e restituzione di oggetti utente.
A POST
per creare un nuovo utente.
POST /api/v1/users/
{
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>,
"groups" : [<group_1_id>, ...],
"isAdmin" : true | false
}
{
"pid" : <integer>,
"userId": <integer>,
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>,
"groups" : [<group_1_id>, ...],
"isAdmin" : <"true"|"false">
}
Se isAdmin
è impostato su true, l’utente viene creato come amministratore partner. Questa proprietà consente inoltre di sapere se un utente è un amministratore partner.
Restituisce 409 Conflict
se il nome utente è già utilizzato.
A PUT
per aggiornare un utente.
PUT /api/v1/users/
<userId>
{
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>,
"groups" : [<group_1_id>, ...]
}
{
"pid" : <integer>,
"userId": <integer>,
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"groups" : [<group_1_id>, ...]
}
Restituisce 409 Conflict
se il nome utente è già utilizzato.
A PUT
per aggiornare l'utente attualmente connesso.
Mentre gran parte API I metodi possono essere richiamati solo dagli amministratori partner. Questo metodo può essere chiamato anche da utenti non amministratori.
PUT /self/update
{
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>
}
{
"userId": <integer>,,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>
}
Restituisce 409 Conflict
se il nome utente è già utilizzato.
A PUT
per aggiornare l'utente attualmente connesso.
Mentre gran parte API I metodi possono essere richiamati solo dagli amministratori partner. Questo metodo può essere chiamato anche da utenti non amministratori.
POST /users/self/update-password
{ "oldPassword" : "old password", "newPassword" : "new password" }
Restituisce 200 OK
in caso di esito positivo. Restituisce 400 Bad Request
se si è verificato un errore con una delle due password.
A PUT
per reimpostare l'utente attualmente connesso. Audience Management invia all'utente una password generata dal sistema.
Mentre gran parte API I metodi possono essere richiamati solo dagli amministratori partner. Questo metodo può essere chiamato anche da utenti non amministratori.
POST /self/reset-password
Restituisce 200 OK
in caso di esito positivo.
A Get
per restituire l'oggetto utente per un ID utente.
GET /api/v1/users/
<userId>
{
"pid" : <integer>,
"userId": <integer>,
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>,
"groups" : [<groupd_id_1>, ...]
}
A Get
per restituire l'oggetto utente per l'utente attualmente connesso.
Mentre gran parte API I metodi possono essere richiamati solo dagli amministratori partner. Questo metodo può essere chiamato anche da utenti non amministratori.
GET /api/v1/users/self
{
"pid" : <integer>,
"userId": <integer>,
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email" : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>,
"groups" : [<groupd_id_1>, ...]
}
A GET
per elencare gli utenti.
GET /api/v1/users/
Puoi specificare più ID gruppo nei parametri della query:
GET /api/v1/users/?groupId=343&groupdId=12
Questa query restituisce un elenco di tutti gli utenti nei gruppi specificati.
{
"pid" : <integer>,
"userId": <integer>,
"username" : <string>,
"status" : <"ACTIVE"|"INACTIVE"|"LOCKED">
"firstName" : <string>,
"lastName" : <string>,
"email : <string>,
"title" : <string_may_be_null>,
"phoneNumber" : <string_may_be_null>,
"groups" : [<group_1_id>, ...]
}
A DELETE
per eliminare un utente.
DELETE /api/v1/users/
<user_id>
Restituisce 204 No Content
in caso di esito positivo. In caso di restituzione in conflitto 409 Conflict
.
A POST
per eliminare più utenti in blocco.
POST /api/v1/users/bulk-delete
{[<user_id_1>, <user_id_2>, ...]}