BokaMera.API.Host

<back to all web services

SuperAdminCreateCompanyUser

Requires Authentication
Requires the role:superadmin
The following routes are available for this service:
POST/superadmin/administrators/Add a new administrator to your companyIf you want to add a new administrator to your company. A generated password will be sent to the user.
namespace BokaMera.API.ServiceModel.Dtos

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type CompanyUserResource() = 
        ///<summary>
        ///The resource id
        ///</summary>
        [<ApiMember(Description="The resource id")>]
        member val Id:Int32 = new Int32() with get,set

        ///<summary>
        ///The resource name
        ///</summary>
        [<ApiMember(Description="The resource name")>]
        member val Name:String = null with get,set

        ///<summary>
        ///The resource status
        ///</summary>
        [<ApiMember(Description="The resource status")>]
        member val Active:Boolean = new Boolean() with get,set

        ///<summary>
        ///The resource description
        ///</summary>
        [<ApiMember(Description="The resource description")>]
        member val Description:String = null with get,set

        ///<summary>
        ///The resource email
        ///</summary>
        [<ApiMember(Description="The resource email")>]
        member val Email:String = null with get,set

        ///<summary>
        ///The resource phone
        ///</summary>
        [<ApiMember(Description="The resource phone")>]
        member val Phone:String = null with get,set

        ///<summary>
        ///The resource color
        ///</summary>
        [<ApiMember(Description="The resource color")>]
        member val Color:String = null with get,set

        ///<summary>
        ///The resource image
        ///</summary>
        [<ApiMember(Description="The resource image")>]
        member val ImageUrl:Uri = null with get,set

        ///<summary>
        ///If the resource want to receive email notifications
        ///</summary>
        [<ApiMember(Description="If the resource want to receive email notifications")>]
        member val EmailNotification:Boolean = new Boolean() with get,set

        ///<summary>
        ///If the resource want to receive sms notifications
        ///</summary>
        [<ApiMember(Description="If the resource want to receive sms notifications")>]
        member val SMSNotification:Boolean = new Boolean() with get,set

        ///<summary>
        ///If the resource want to receive email reminders
        ///</summary>
        [<ApiMember(Description="If the resource want to receive email reminders")>]
        member val EmailReminder:Boolean = new Boolean() with get,set

        ///<summary>
        ///If the resource want to receive sms reminders
        ///</summary>
        [<ApiMember(Description="If the resource want to receive sms reminders")>]
        member val SMSReminder:Boolean = new Boolean() with get,set

    [<AllowNullLiteral>]
    type CompanyUserRolesQueryResponse() = 
        member val RoleId:Guid = new Guid() with get,set
        member val Name:String = null with get,set
        member val Description:String = null with get,set

    [<AllowNullLiteral>]
    type CompanyUserQueryResponse() = 
        member val Id:Guid = new Guid() with get,set
        member val CompanyId:Guid = new Guid() with get,set
        member val Firstname:String = null with get,set
        member val Lastname:String = null with get,set
        member val Email:String = null with get,set
        member val Phone:String = null with get,set
        member val WorkerId:String = null with get,set
        member val ResourceId:Nullable<Int32> = new Nullable<Int32>() with get,set
        ///<summary>
        ///The resource information connected to the administrator.
        ///</summary>
        [<ApiMember(Description="The resource information connected to the administrator.")>]
        member val Resource:CompanyUserResource = null with get,set

        ///<summary>
        ///The roles that are connected to the administrator.
        ///</summary>
        [<ApiMember(Description="The roles that are connected to the administrator.")>]
        member val Roles:ResizeArray<CompanyUserRolesQueryResponse> = new ResizeArray<CompanyUserRolesQueryResponse>() with get,set

        member val Active:Boolean = new Boolean() with get,set
        member val Created:DateTime = new DateTime() with get,set
        member val Updated:DateTime = new DateTime() with get,set

    [<AllowNullLiteral>]
    type AddCompanyUserRolesResponse() = 
        member val RoleId:Guid = new Guid() with get,set

    [<ApiResponse(Description="Returned if there is a validation error on the input parameters", StatusCode=400)>]
    [<ApiResponse(Description="Returned if the current user is not allowed to perform the action", StatusCode=401)>]
    [<AllowNullLiteral>]
    type SuperAdminCreateCompanyUser() = 
        ///<summary>
        ///Enter the company and id for the customer, if blank company id and you are an admin, your company id will be used.
        ///</summary>
        [<ApiMember(Description="Enter the company and id for the customer, if blank company id and you are an admin, your company id will be used.", ParameterType="query")>]
        member val CompanyId:Nullable<Guid> = new Nullable<Guid>() with get,set

        [<ApiMember(IsRequired=true)>]
        member val Firstname:String = null with get,set

        [<ApiMember(IsRequired=true)>]
        member val Lastname:String = null with get,set

        [<ApiMember(IsRequired=true)>]
        member val Phone:String = null with get,set

        [<ApiMember(IsRequired=true)>]
        member val Email:String = null with get,set

        [<ApiMember>]
        member val ResourceId:Nullable<Int32> = new Nullable<Int32>() with get,set

        [<ApiMember>]
        member val Roles:ResizeArray<AddCompanyUserRolesResponse> = new ResizeArray<AddCompanyUserRolesResponse>() with get,set

        [<ApiMember>]
        member val WorkerId:Nullable<Int32> = new Nullable<Int32>() with get,set

F# SuperAdminCreateCompanyUser DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /superadmin/administrators/ HTTP/1.1 
Host: api.bokamera.se 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Firstname":"String","Lastname":"String","Phone":"String","Email":"String","ResourceId":0,"Roles":[{}],"WorkerId":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Firstname":"String","Lastname":"String","Email":"String","Phone":"String","WorkerId":"String","ResourceId":0,"Resource":{"Id":0,"Name":"String","Active":false,"Description":"String","Email":"String","Phone":"String","Color":"String","EmailNotification":false,"SMSNotification":false,"EmailReminder":false,"SMSReminder":false},"Roles":[{"Name":"String","Description":"String"}],"Active":false}