Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
POST | /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. |
---|
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
@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)
@ValidateRequest(Validator="IsAuthenticated")
open class CreateCompanyUser : ICompany
{
/**
* Enter the company and id for the customer, if blank company id and you are an admin, your company id will be used.
*/
@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")
override var CompanyId:UUID? = null
@ApiMember(IsRequired=true)
open var Firstname:String? = null
@ApiMember(IsRequired=true)
open var Lastname:String? = null
@ApiMember(IsRequired=true)
open var Phone:String? = null
@ApiMember(IsRequired=true)
open var Email:String? = null
@ApiMember()
open var ResourceId:Int? = null
@ApiMember()
open var Roles:ArrayList<AddCompanyUserRolesResponse>? = null
@ApiMember()
open var WorkerId:Int? = null
/**
* If the admin should receive Push notification when booked
*/
@ApiMember(Description="If the admin should receive Push notification when booked")
open var SendPushNotification:Boolean? = null
/**
* If the resource should receive Push notification reminders on bookings
*/
@ApiMember(Description="If the resource should receive Push notification reminders on bookings")
open var SendPushNotificationReminder:Boolean? = null
}
open class AddCompanyUserRolesResponse
{
open var RoleId:UUID? = null
}
open class CompanyUserQueryResponse
{
open var Id:UUID? = null
open var CompanyId:UUID? = null
open var Firstname:String? = null
open var Lastname:String? = null
open var Email:String? = null
open var Phone:String? = null
open var WorkerId:String? = null
open var ResourceId:Int? = null
/**
* The resource information connected to the administrator.
*/
@ApiMember(Description="The resource information connected to the administrator.")
open var Resource:CompanyUserResource? = null
/**
* The roles that are connected to the administrator.
*/
@ApiMember(Description="The roles that are connected to the administrator.")
open var Roles:ArrayList<CompanyUserRolesQueryResponse>? = null
/**
* If the admin should receive Push notification when booked
*/
@ApiMember(Description="If the admin should receive Push notification when booked")
open var SendPushNotification:Boolean? = null
/**
* If the admin should receive Push notification reminders on bookings
*/
@ApiMember(Description="If the admin should receive Push notification reminders on bookings")
open var SendPushNotificationReminder:Boolean? = null
open var Active:Boolean? = null
open var Created:Date? = null
open var Updated:Date? = null
}
open class CompanyUserResource
{
/**
* The resource id
*/
@ApiMember(Description="The resource id")
open var Id:Int? = null
/**
* The resource name
*/
@ApiMember(Description="The resource name")
open var Name:String? = null
/**
* The resource status
*/
@ApiMember(Description="The resource status")
open var Active:Boolean? = null
/**
* The resource description
*/
@ApiMember(Description="The resource description")
open var Description:String? = null
/**
* The resource email
*/
@ApiMember(Description="The resource email")
open var Email:String? = null
/**
* The resource phone
*/
@ApiMember(Description="The resource phone")
open var Phone:String? = null
/**
* The resource color
*/
@ApiMember(Description="The resource color")
open var Color:String? = null
/**
* The resource image
*/
@ApiMember(Description="The resource image")
open var ImageUrl:Uri? = null
/**
* If the resource want to receive email notifications
*/
@ApiMember(Description="If the resource want to receive email notifications")
open var EmailNotification:Boolean? = null
/**
* If the resource want to receive sms notifications
*/
@ApiMember(Description="If the resource want to receive sms notifications")
open var SMSNotification:Boolean? = null
/**
* If the resource want to receive email reminders
*/
@ApiMember(Description="If the resource want to receive email reminders")
open var EmailReminder:Boolean? = null
/**
* If the resource want to receive sms reminders
*/
@ApiMember(Description="If the resource want to receive sms reminders")
open var SMSReminder:Boolean? = null
}
open class CompanyUserRolesQueryResponse
{
open var RoleId:UUID? = null
open var Name:String? = null
open var Description:String? = null
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /administrators/ HTTP/1.1
Host: api.bookmore.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"CompanyId":"00000000-0000-0000-0000-000000000000","Firstname":"String","Lastname":"String","Phone":"String","Email":"String","ResourceId":0,"Roles":[{}],"WorkerId":0,"SendPushNotification":false,"SendPushNotificationReminder":false}
HTTP/1.1 200 OK Content-Type: text/jsonl 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"}],"SendPushNotification":false,"SendPushNotificationReminder":false,"Active":false}