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 .xml suffix or ?format=xml

HTTP + XML

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: testapi.bokamera.se 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<SuperAdminCreateCompanyUser xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <Email>String</Email>
  <Firstname>String</Firstname>
  <Lastname>String</Lastname>
  <Phone>String</Phone>
  <ResourceId>0</ResourceId>
  <Roles>
    <AddCompanyUserRolesResponse>
      <RoleId>00000000-0000-0000-0000-000000000000</RoleId>
    </AddCompanyUserRolesResponse>
  </Roles>
  <WorkerId>0</WorkerId>
</SuperAdminCreateCompanyUser>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CompanyUserQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Active>false</Active>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <Created>0001-01-01T00:00:00</Created>
  <Email>String</Email>
  <Firstname>String</Firstname>
  <Id>00000000-0000-0000-0000-000000000000</Id>
  <Lastname>String</Lastname>
  <Phone>String</Phone>
  <Resource>
    <Active>false</Active>
    <Color>String</Color>
    <Description>String</Description>
    <Email>String</Email>
    <EmailNotification>false</EmailNotification>
    <EmailReminder>false</EmailReminder>
    <Id>0</Id>
    <ImageUrl i:nil="true" />
    <Name>String</Name>
    <Phone>String</Phone>
    <SMSNotification>false</SMSNotification>
    <SMSReminder>false</SMSReminder>
  </Resource>
  <ResourceId>0</ResourceId>
  <Roles>
    <CompanyUserRolesQueryResponse>
      <Description>String</Description>
      <Name>String</Name>
      <RoleId>00000000-0000-0000-0000-000000000000</RoleId>
    </CompanyUserRolesQueryResponse>
  </Roles>
  <Updated>0001-01-01T00:00:00</Updated>
  <WorkerId>String</WorkerId>
</CompanyUserQueryResponse>