Requires the role: | superadmin |
POST | /superadmin/administrators/ | Add a new administrator to your company | If you want to add a new administrator to your company. A generated password will be sent to the user. |
---|
"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 SuperAdminCreateCompanyUser {
/** @param {{CompanyId?: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 customer, if blank company id and you are an admin, your company id will be used. */
CompanyId;
/** @type {string} */
Firstname;
/** @type {string} */
Lastname;
/** @type {string} */
Phone;
/** @type {string} */
Email;
/** @type {?number} */
ResourceId;
/** @type {AddCompanyUserRolesResponse[]} */
Roles;
/** @type {?number} */
WorkerId;
}
JavaScript 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
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}