GET /api/users
Gets all users defined in the system user limit=x&offset=n to paginate To include email,access and roles, use following parameters &includeEmailAddresses=true&includeUserAccess=true&includeRoles=true
Parameters
| Name | In | Description | Required | Type |
|---|---|---|---|---|
| limit | query | Limit reponse to x rows. Default: 100 | integer | |
| offset | query | offset reponse rows | integer | |
| includeEmailAddresses | query | bool to include or exclude user email addresses | boolean | |
| includeUserAccess | query | bool to include or exclude user access information | boolean | |
| includeRoles | query | bool to include or exclude roles assigned to user | boolean |
Responses
| Code | Returns | Type |
|---|---|---|
| 200 | Ok | Acos.Websak.UserAPI.Core.Models.WebsakUser[] |
| 500 | Error fetching data | |
| 204 | No content, if no users are registered | |
| 401 | Unauthorized - Missing or invalid access token | |
| 403 | Forbidden - Provided access token does not permit usage of this API or data |
Response Example
[{
"gidId":"string",
"externalUsername":"string",
"active":"boolean",
"orgUnitId":"string",
"userRequestJsonString":"string",
"accessTemplateId":"string",
"nationalNo":"string",
"code":"string",
"name":"string",
"title":"string",
"countryId":"string",
"postalNo":"string",
"contact":"string",
"addr":"string",
"addr2":"string",
"phone":"string",
"phone2":"string",
"mobile":"string",
"emailAddr":"string",
"emailAddr2":"string",
"languageId":"string",
"departmentId":"string",
"departmentCode":"string",
"accountNumber":"string",
"note":"string",
"place":"string",
"municipalityNo":"string",
"visitingAddress":"string",
"misc1":"string",
"misc2":"string",
"misc3":"string",
"misc4":"string",
"misc5":"string",
"addr3":"string",
"addr4":"string",
"leaveFrom":"string",
"leaveTo":"string",
"categoryId":"string",
"userAccessCodes":"string",
"userAccessFunctions":
[{
"id": "integer",
"code": "string",
"name": "string",
"description": "string"
}]
,
"userRoles":
[{
"roleId": "string",
"roleUserId": "string",
"departmentList": "string",
"archiveList": "string",
"journalUnitList": "string",
"gradeList": "string",
"id": "string",
"description": "string"
}]
}]POST /api/users
Create a new WebsakUser from JSON object provided.Returns JSON object representing created user.
Description
Creates a Websak user based on the JSON data provided in the request. ExternalDepartmentID – External department id, this value will be matched against misc1 for lookup value. DepartmentCode - Department code => value will be matched against Department unit code. ExternalDepartmentID is then disregarded. TilgangsOppsettID – ID for template for the user being created, the user gets access and roles based on this template. LookupField - Name of field that is used to lookup existing user. Possible values: Id (default) and Code. Parameters: JSON Data object Acos.Websak.UserAPI.Core.Models.UserRequest
Request body
{
"username":"string",
"externalDepartmentId":"string",
"departmentCode":"string",
"mailAddresses":,
"id":"string",
"lookupField":"string",
"userType":"string",
"userAccesses":
[{
"domain": "string",
"provider": "string",
"key": "string",
"isPrimary": "boolean",
"id": "integer"
}]
,
"accessToZones":,
"accessTemplateId":"string",
"nationalNo":"string",
"code":"string",
"name":"string",
"title":"string",
"countryId":"string",
"postalNo":"string",
"contact":"string",
"addr":"string",
"addr2":"string",
"phone":"string",
"phone2":"string",
"mobile":"string",
"emailAddr":"string",
"emailAddr2":"string",
"languageId":"string",
"departmentId":"string",
"accountNumber":"string",
"note":"string",
"place":"string",
"municipalityNo":"string",
"visitingAddress":"string",
"misc1":"string",
"misc2":"string",
"misc3":"string",
"misc4":"string",
"misc5":"string",
"addr3":"string",
"addr4":"string",
"leaveFrom":"string",
"leaveTo":"string",
"categoryId":"string",
"userAccessCodes":"string",
"userAccessFunctions":
[{
"id": "integer",
"code": "string",
"name": "string",
"description": "string"
}]
,
"userRoles":
[{
"roleId": "string",
"roleUserId": "string",
"departmentList": "string",
"archiveList": "string",
"journalUnitList": "string",
"gradeList": "string",
"id": "string",
"description": "string"
}]
}Responses
| Code | Returns | Type |
|---|---|---|
| 201 | Created json object with new/updated user, and the GET url to user api/user/{newId}. | Acos.Websak.UserAPI.Core.Models.WebsakUser |
| 200 | Object with updated user, and the GET url to user api/user/{newId}. | Acos.Websak.UserAPI.Core.Models.WebsakUser |
| 500 | Internal server error with message. | |
| 401 | Unauthorized - Missing or invalid access token | |
| 403 | Forbidden - Provided access token does not permit usage of this API or data |
Response Example
{
"gidId":"string",
"externalUsername":"string",
"active":"boolean",
"orgUnitId":"string",
"userRequestJsonString":"string",
"accessTemplateId":"string",
"nationalNo":"string",
"code":"string",
"name":"string",
"title":"string",
"countryId":"string",
"postalNo":"string",
"contact":"string",
"addr":"string",
"addr2":"string",
"phone":"string",
"phone2":"string",
"mobile":"string",
"emailAddr":"string",
"emailAddr2":"string",
"languageId":"string",
"departmentId":"string",
"departmentCode":"string",
"accountNumber":"string",
"note":"string",
"place":"string",
"municipalityNo":"string",
"visitingAddress":"string",
"misc1":"string",
"misc2":"string",
"misc3":"string",
"misc4":"string",
"misc5":"string",
"addr3":"string",
"addr4":"string",
"leaveFrom":"string",
"leaveTo":"string",
"categoryId":"string",
"userAccessCodes":"string",
"userAccessFunctions":
[{
"id": "integer",
"code": "string",
"name": "string",
"description": "string"
}]
,
"userRoles":
[{
"roleId": "string",
"roleUserId": "string",
"departmentList": "string",
"archiveList": "string",
"journalUnitList": "string",
"gradeList": "string",
"id": "string",
"description": "string"
}]
}