BokaMera.API.Host

<back to all web services

UpdateCompanyUser

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/administrators/{Id}Update administrator on your companyIf you want to update a administrator to your company.
"use strict";
export class CompanyUserResource {
    /** @param {{Id?:number,Name?:string,Active?:boolean,Description?:string,Email?:string,Phone?:string,Color?:string,ImageUrl?:string,EmailNotification?:boolean,SMSNotification?:boolean,EmailReminder?:boolean,SMSReminder?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The resource id */
    Id;
    /**
     * @type {string}
     * @description The resource name */
    Name;
    /**
     * @type {boolean}
     * @description The resource status */
    Active;
    /**
     * @type {string}
     * @description The resource description */
    Description;
    /**
     * @type {string}
     * @description The resource email */
    Email;
    /**
     * @type {string}
     * @description The resource phone */
    Phone;
    /**
     * @type {string}
     * @description The resource color */
    Color;
    /**
     * @type {string}
     * @description The resource image */
    ImageUrl;
    /**
     * @type {boolean}
     * @description If the resource want to receive email notifications */
    EmailNotification;
    /**
     * @type {boolean}
     * @description If the resource want to receive sms notifications */
    SMSNotification;
    /**
     * @type {boolean}
     * @description If the resource want to receive email reminders */
    EmailReminder;
    /**
     * @type {boolean}
     * @description If the resource want to receive sms reminders */
    SMSReminder;
}
export class CompanyUserRolesQueryResponse {
    /** @param {{RoleId?:string,Name?:string,Description?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    RoleId;
    /** @type {string} */
    Name;
    /** @type {string} */
    Description;
}
export class CompanyUserQueryResponse {
    /** @param {{Id?:string,CompanyId?:string,Firstname?:string,Lastname?:string,Email?:string,Phone?:string,WorkerId?:string,ResourceId?:number,Resource?:CompanyUserResource,Roles?:CompanyUserRolesQueryResponse[],Active?:boolean,Created?:string,Updated?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Id;
    /** @type {string} */
    CompanyId;
    /** @type {string} */
    Firstname;
    /** @type {string} */
    Lastname;
    /** @type {string} */
    Email;
    /** @type {string} */
    Phone;
    /** @type {string} */
    WorkerId;
    /** @type {?number} */
    ResourceId;
    /**
     * @type {CompanyUserResource}
     * @description The resource information connected to the administrator. */
    Resource;
    /**
     * @type {CompanyUserRolesQueryResponse[]}
     * @description The roles that are connected to the administrator. */
    Roles;
    /** @type {boolean} */
    Active;
    /** @type {string} */
    Created;
    /** @type {string} */
    Updated;
}
export class AddCompanyUserRolesResponse {
    /** @param {{RoleId?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    RoleId;
}
export class UpdateCompanyUser {
    /** @param {{CompanyId?:string,Id?:string,Firstname?:string,Lastname?:string,Phone?:string,Email?:string,ResourceId?:number,Roles?:AddCompanyUserRolesResponse[],WorkerId?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {?string}
     * @description Enter the company and id for the application user, if blank company id and you are an admin, your company id will be used. */
    CompanyId;
    /**
     * @type {string}
     * @description Enter the user id for the administrator. */
    Id;
    /** @type {string} */
    Firstname;
    /** @type {string} */
    Lastname;
    /** @type {string} */
    Phone;
    /** @type {string} */
    Email;
    /** @type {?number} */
    ResourceId;
    /** @type {AddCompanyUserRolesResponse[]} */
    Roles;
    /** @type {?number} */
    WorkerId;
}

JavaScript UpdateCompanyUser 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.

PUT /administrators/{Id} HTTP/1.1 
Host: api.bokamera.se 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<UpdateCompanyUser 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>
  <Id>00000000-0000-0000-0000-000000000000</Id>
  <Lastname>String</Lastname>
  <Phone>String</Phone>
  <ResourceId>0</ResourceId>
  <Roles>
    <AddCompanyUserRolesResponse>
      <RoleId>00000000-0000-0000-0000-000000000000</RoleId>
    </AddCompanyUserRolesResponse>
  </Roles>
  <WorkerId>0</WorkerId>
</UpdateCompanyUser>
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>