GET /api/users/{id}

Returns a single websak user

Description

Gets one singe user.

Parameter {id}: Value can be of gid id or username.

Return values: One JSON object containing data for requested user.

Parameters

Name In Description Required Type
id path User AD string identifier or login id true string
lookupField query default=Id, Possible values: Id (default) and Code. string
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 Requested user Acos.Websak.UserAPI.Core.Models.WebsakUser
404 User not found Microsoft.AspNetCore.Mvc.ProblemDetails
500 Server error
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"
        }]
    
}

PUT /api/users/{id}

Updates websak user with data from JSON object provided. All values from JSON object updates stored object.

Description

Updates user based on values in JSON object in request. Values in the request will be mapped to Websak user. Values not included in JSON will be translated either to "" (empty string) or [null]. Side effect: Not included properties will cause data to be deleted/overwritten. Include all data always. If external department and/or access is changed, then current access are reset to new access profile. Return values : 200 OK - User Created/Updated. 404 - Unknown user 500 - Error message contains more details

Parameters

Name In Description Required Type
id path true string

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
200 OK Acos.Websak.UserAPI.Core.Models.WebsakUser
400 Bad Request
404 Not Found
500 Internal Server Error
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"
        }]
    
}