User
A "User" entity describes a user of the Adways ecosystem. Creating a user doesn't mean, "to give him the ability to log in and perform API requests or RPC calls"; it only creates a descriptive card. A full profile is the association of a user and an authentification method. Adways mechanism allows to use various authentification systems per user. The "Identifier" API is responsible for maintaining the link between a user and an authentification method (see the "createIdentify" RPC in this API). As a helper, the current API also provides the "CreateProfileFromAuthID" RPC that performs the creation of a user inside the "User" API and the creation of the link inside the "Identifier" API in one request.
Fields
Field | Description | Required |
---|---|---|
first_name | The user's first name. | YES |
last_name | The user's last name. | YES |
company | The user's company when the account is used for a professionnal purpose. | YES |
The user's e-mail adress. | NO | |
address | The user's home or its company address. | NO |
phone | The user's phone. | NO |
photo | The user's avatar. | NO |
skype | The user's skype pseudonym. | NO |
status | The user's status within the Adways environment: "manager" or "user". | NO |
language | NO | |
company_id | The user's company_id when the account is used for a professionnal purpose. | YES |
keycloak | NO |
GET /user
Loads a collection of available entities. The loaded collection is paginated. An optional "search" parameter is available to filter the result on the entities' name and id (ex.: "//user?search=SearchValue").
Request
EndPoint
https://services.adways.com/user
Headers
Header | Value |
---|---|
Accept | application/vnd.user-manager.v1+json
application/hal+json
application/json |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 403: Forbidden
Headers
Header | Value |
---|---|
Content-Type | application/vnd.user-manager.v1+json
application/hal+json
application/json |
Allow | Comma-separated list of all HTTP methods allowed |
Body
{ "_links": { "self": { "href": "/user" }, "first": { "href": "/user?page={page}" }, "prev": { "href": "/user?page={page}" }, "next": { "href": "/user?page={page}" }, "last": { "href": "/user?page={page}" } }, "_embedded": { "collection": [ { "id": "", "created": "", "author": "", "updated": "", "updator": "", "level": "", "state": "", "first_name": "The user's first name.", "last_name": "The user's last name.", "company": "The user's company when the account is used for a professionnal purpose.", "email": "The user's e-mail adress.", "address": "The user's home or its company address.", "phone": "The user's phone.", "photo": "The user's avatar.", "skype": "The user's skype pseudonym.", "status": "The user's status within the Adways environment: "manager" or "user".", "language": "", "company_id": "The user's company_id when the account is used for a professionnal purpose.", "keycloak": "", "_links": { "self": { "href": "/user[/:user_id]" } } } ] } }
POST /user
When a user creates another user, by default he is allowed to update and delete him. Note that the status attribute cannot be updated later.
Creates an entity in User. Required fields are in the API fields description above. Note that on success, the returned http status is "201, Created".
Request
EndPoint
https://services.adways.com/user
Headers
Header | Value |
---|---|
Accept | application/vnd.user-manager.v1+json
application/hal+json
application/json |
Content-Type | application/vnd.user-manager.v1+json
application/json |
Body
{ "first_name": "", "last_name": "", "company": "", "email": "user mail", "address": "", "phone": "", "photo": "", "skype": "", "status": "Manager or User" }
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 201: Created
- 400: Client Error
- 422: Unprocessable Entity
- 403: Forbidden
Headers
Header | Value |
---|---|
Content-Type | application/vnd.user-manager.v1+json
application/hal+json
application/json |
Allow | Comma-separated list of all HTTP methods allowed |
Body
{ "id": "", "created": "", "author": "", "updated": "", "updator": "", "level": "", "state": "", "first_name": "The user's first name.", "last_name": "The user's last name.", "company": "The user's company when the account is used for a professionnal purpose.", "email": "The user's e-mail adress.", "address": "The user's home or its company address.", "phone": "The user's phone.", "photo": "The user's avatar.", "skype": "The user's skype pseudonym.", "status": "The user's status within the Adways environment: "manager" or "user".", "language": "", "company_id": "The user's company_id when the account is used for a professionnal purpose.", "keycloak": "", "_links": { "self": { "href": "/user[/:user_id]" } } }
GET /user[/:user_id]
Loads the entity with the given id.
Request
EndPoint
https://services.adways.com/user[/:user_id]
Headers
Header | Value |
---|---|
Accept | application/vnd.user-manager.v1+json
application/hal+json
application/json |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 403: Forbidden
Headers
Header | Value |
---|---|
Content-Type | application/vnd.user-manager.v1+json
application/hal+json
application/json |
Allow | Comma-separated list of all HTTP methods allowed |
Body
{ "id": "", "created": "", "author": "", "updated": "", "updator": "", "level": "", "state": "", "first_name": "The user's first name.", "last_name": "The user's last name.", "company": "The user's company when the account is used for a professionnal purpose.", "email": "The user's e-mail adress.", "address": "The user's home or its company address.", "phone": "The user's phone.", "photo": "The user's avatar.", "skype": "The user's skype pseudonym.", "status": "The user's status within the Adways environment: "manager" or "user".", "language": "", "company_id": "The user's company_id when the account is used for a professionnal purpose.", "keycloak": "", "_links": { "self": { "href": "/user[/:user_id]" } } }
PATCH /user[/:user_id]
Updates a subset of the entity with the given id (only the modified fields are required).
Request
EndPoint
https://services.adways.com/user[/:user_id]
Headers
Header | Value |
---|---|
Accept | application/vnd.user-manager.v1+json
application/hal+json
application/json |
Content-Type | application/vnd.user-manager.v1+json
application/json |
Body
{ "first_name": "", "last_name": "", "company": "", "email": "user mail", "address": "", "phone": "", "photo": "", "skype": "", "status": "Manager or User" }
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 403: Forbidden
Headers
Header | Value |
---|---|
Content-Type | application/vnd.user-manager.v1+json
application/hal+json
application/json |
Allow | Comma-separated list of all HTTP methods allowed |
Body
{ "id": "", "created": "", "author": "", "updated": "", "updator": "", "level": "", "state": "", "first_name": "The user's first name.", "last_name": "The user's last name.", "company": "The user's company when the account is used for a professionnal purpose.", "email": "The user's e-mail adress.", "address": "The user's home or its company address.", "phone": "The user's phone.", "photo": "The user's avatar.", "skype": "The user's skype pseudonym.", "status": "The user's status within the Adways environment: "manager" or "user".", "language": "", "company_id": "The user's company_id when the account is used for a professionnal purpose.", "keycloak": "", "_links": { "self": { "href": "/user[/:user_id]" } } }
PUT /user[/:user_id]
Updates the entire entity with the given id (all the fields are required).
Request
EndPoint
https://services.adways.com/user[/:user_id]
Headers
Header | Value |
---|---|
Accept | application/vnd.user-manager.v1+json
application/hal+json
application/json |
Content-Type | application/vnd.user-manager.v1+json
application/json |
Body
{ "first_name": "", "last_name": "", "company": "", "email": "user mail", "address": "", "phone": "", "photo": "", "skype": "", "status": "Manager or User" }
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 200: OK
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 403: Forbidden
Headers
Header | Value |
---|---|
Content-Type | application/vnd.user-manager.v1+json
application/hal+json
application/json |
Allow | Comma-separated list of all HTTP methods allowed |
Body
{ "id": "", "created": "", "author": "", "updated": "", "updator": "", "level": "", "state": "", "first_name": "The user's first name.", "last_name": "The user's last name.", "company": "The user's company when the account is used for a professionnal purpose.", "email": "The user's e-mail adress.", "address": "The user's home or its company address.", "phone": "The user's phone.", "photo": "The user's avatar.", "skype": "The user's skype pseudonym.", "status": "The user's status within the Adways environment: "manager" or "user".", "language": "", "company_id": "The user's company_id when the account is used for a professionnal purpose.", "keycloak": "", "_links": { "self": { "href": "/user[/:user_id]" } } }
DELETE /user[/:user_id]
Deletes the entity with the given id. Note that on success, the returned http status is "204, Entity has been deleted".
Request
EndPoint
https://services.adways.com/user[/:user_id]
Headers
Header | Value |
---|---|
Accept | application/vnd.user-manager.v1+json
application/hal+json
application/json |
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 204: No Content
- 404: Not Found
- 403: Forbidden
Headers
Header | Value |
---|---|
Content-Type | application/vnd.user-manager.v1+json
application/hal+json
application/json |
Allow | Comma-separated list of all HTTP methods allowed |
CreateProfileFromAuthID
Creates a full profile from the user's attributes and the user's unique id, generated by an authentification system. An authentification system can be any kind of token based authentification method, not necessarily the Adways one; and the user's unique id should be the key that uniquely identify the user inside this system. To secure the creation of profile: first, the request header must contain a token of someone that has the "user creation rights"; and secondly, the server that performs the request must provide a "client id" and "client secret" (that ensures that the user creator only creates users linked to the authentification methods he can access). (Reminder: a full profile is the association of a user and an authentification method; see the "User" REST API description above).
Fields
Field | Description | Required |
---|---|---|
client_id | The authentification server credential's "client id". | YES |
client_secret | The authentification server credential's "client secret". | YES |
auth_id | The user's unique id that identifies it inside the authentification system. | YES |
first_name | The created user's first name. | YES |
last_name | The created user's last name. | YES |
POST /create-profile-from-auth-id
Request
EndPoint
https://services.adways.com/create-profile-from-auth-id
Headers
Header | Value |
---|---|
Accept | application/vnd.user-manager.v1+json
application/json
application/*+json |
Content-Type | application/vnd.user-manager.v1+json
application/json |
Body
{ "client_id": "your client_id credential", "client_secret": "your client_secret credential", "auth_id": "user unique id from your platform", "first_name": "", "last_name": "" }
Response
Status Codes
- 406: Not Acceptable
- 415: Unsupported Media Type
- 201: Created
- 404: Not Found
- 400: Client Error
- 422: Unprocessable Entity
- 403: Forbidden
Headers
Header | Value |
---|---|
Content-Type | application/vnd.user-manager.v1+json
application/json
application/*+json |
Allow | Comma-separated list of all HTTP methods allowed |
Body
{ "id": "", "created": "", "author": "", "updated": "", "updator": "", "level": "", "state": "", "first_name": "", "last_name": "", "company": "", "email": "user mail", "address": "", "phone": "", "photo": "", "skype": "", "status": "Manager or User", "_links": { "self": { "href": "/user[/:user_id]" } } }