BokaMera.API.Host

<back to all web services

CreateResourceType

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/resourcetypesAdd a new resourcetypeAdd a new resourcetype to the company of the currently logged in user, only administrators are allowed to add resourcetypes.
CreateResourceType Parameters:
NameParameterData TypeRequiredDescription
CompanyIdbodyGuid?NoThe company id, if empty will use the company id for the user you are logged in with.
NamebodystringNoThe resourcetype name
ResourcesbodyList<AddResourceTypeResource>NoThe resources to be included
DescriptionbodystringNoThe resourcetype description
ActivebodyboolNoIf resourcetype is active or not
AddResourceTypeResource Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe resource id
PriorityformintNoThe priority of the resource. If no priority is set it will take random resource when booking a time.
ResourceTypeQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe resourcetype id
NameformstringNoThe resourcetype name
DescriptionformstringNoThe resourcetype description
ResourcesformList<ResourceTypeResource>NoThe resources in the resourcetype. Only shows active resources if not admin.
ActiveformboolNoIf resourcetype is active or not
CreatedformDateTimeNoThen date when the resource was created
UpdatedformDateTimeNoThen date when the resource was updated
ResourceTypeResource Parameters:
NameParameterData TypeRequiredDescription
IdformintNoThe resource id
NameformstringNoThe resource name
ActiveformboolNoThe resource status
DescriptionformstringNoThe resource description
EmailformstringNoThe resource email
PhoneformstringNoThe resource phone
ColorformstringNoThe resource color
ImageUrlformUriNoThe resource image
PriorityformintNoThe priority of the resource
EmailNotificationformboolNoIf the resource want to receive email notifications
SMSNotificationformboolNoIf the resource want to receive sms notifications
EmailReminderformboolNoIf the resource want to receive email reminders
SMSReminderformboolNoIf the resource want to receive sms reminders

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

HTTP + JSV

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

POST /resourcetypes HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CompanyId: 00000000-0000-0000-0000-000000000000,
	Name: String,
	Resources: 
	[
		{
			Id: 0,
			Priority: 0
		}
	],
	Description: String,
	Active: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Id: 0,
	Name: String,
	Description: String,
	Resources: 
	[
		{
			Id: 0,
			Name: String,
			Active: False,
			Description: String,
			Email: String,
			Phone: String,
			Color: String,
			Priority: 0,
			EmailNotification: False,
			SMSNotification: False,
			EmailReminder: False,
			SMSReminder: False
		}
	],
	Active: False
}