BokaMera.API.Host

<back to all web services

CreateCustomer

Requires Authentication
Required role:bookingsupplier-administrator-write
The following routes are available for this service:
POST/customersCreate a new customerCreates a new customer, if an admin user is making the request, the user will be associated with the admin user's company.
CreateCustomer Parameters:
NameParameterData TypeRequiredDescription
CompanyIdqueryGuid?NoEnter the company and id for the customer, if blank company id and you are an admin, your company id will be used.
FirstnamebodystringYes
LastnamebodystringYes
PhonebodystringYes
EmailbodystringNo
PinCodebodystringNoIf customer needs an specific PinCode to be able to book the time
CardIdbodystringNoThe customer card id used for code locks
CustomFieldsbodyList<AddCustomField>NoIf Custom Fields are added to the customer, here you will send the id and the value for each custom field to be updated
AccessKeysbodyList<AddUserAccessKey>NoList of Access Keys
AddCustomField Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
ValueformstringNo
AddUserAccessKey Parameters:
NameParameterData TypeRequiredDescription
IdformGuid?No
CompanyIdformGuid?No
AccessKeyTypeIdformintNo
ValueformstringNo
CustomerIdformGuid?No
DescriptionformstringNo
UpdateCustomerResponse Parameters:
NameParameterData TypeRequiredDescription
FacebookUserNameformstringNo
UserIdformGuid?No
CompanyIdformGuid?No
CreatedDateformDateTime?No
DeletedAccessKeysformList<UserAccessKeys>No
CreatedOrUpdatedAccessKeysformList<UserAccessKeys>No
CustomerQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformGuidNo
FirstnameformstringNo
LastnameformstringNo
EmailformstringNo
PhoneformstringNo
ImageUrlformstringNo
CardIdformstringNoThe customer card id used for code locks
CustomFieldsformList<CustomFieldConfigData>No
CustomFieldValuesformList<CustomFieldDataResponse>No
CommentsformList<CustomerCommentsResponse>No
AccessKeysformList<UserAccessKeys>No
PinCodeformstringNoIf customer needs an specific PinCode to be able to book the time
UpdatedformDateTimeNo
CreatedformDateTimeNo
ResponseStatusformObjectNo
SubscribedToNewsletterformboolNo
CustomFieldConfigData Parameters:
NameParameterData TypeRequiredDescription
IdformintNoCustom field id
NameformstringNoConfiguration name. Example: 'Number of persons'.
DescriptionformstringNoCustom field description. Example: 'For how many persons is this booking?'
Widthformint?NoField width. Example: 20 for 20px
DataTypeformstringNoData field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
DefaultValueformstringNoDefault value of the field. Example: '3'
IsMandatoryformboolNoDetermines if the field is required to have a value or not
MandatoryErrorMessageformstringNoError message shown to the user if the field data is required but not entered
MaxLengthformintNoMax lenght of the field
MultipleLineTextformboolNoIf the field should have multiple lines
RegExformstringNoRegular expression used for validation of the field
RegExErrorMessageformstringNoError message shown if the regular expression validation failed
ValuesformList<CustomFieldValueResponse>NoThe values to select from if Datatype is DropDown for this custom field
CustomFieldValueResponse Parameters:
NameParameterData TypeRequiredDescription
ValueformstringNo
CustomFieldDataResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
ColumnformstringNo
NameformstringNo
DescriptionformstringNo
ValueformstringNo
DataTypeformstringNoData field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
CustomerCommentsResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
CustomerIdformGuidNo
CommentsformstringNo
UpdatedformDateTimeNo
CreatedformDateTimeNo
ImageUrlformUriNo
UserAccessKeys Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuidYes
AccessKeyTypeIdformintYes
ValueformstringYes
CustomerIdformGuidYes
DescriptionformstringNo
IdformGuidYes

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

HTTP + CSV

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

POST /customers HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Firstname":"String","Lastname":"String","Phone":"String","Email":"String","PinCode":"String","CardId":"String","CustomFields":[{"Id":0,"Value":"String"}],"AccessKeys":[{"Id":"00000000-0000-0000-0000-000000000000","CompanyId":"00000000-0000-0000-0000-000000000000","AccessKeyTypeId":0,"Value":"String","CustomerId":"00000000-0000-0000-0000-000000000000","Description":"String"}]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"FacebookUserName":"String","UserId":"00000000-0000-0000-0000-000000000000","CompanyId":"00000000-0000-0000-0000-000000000000","CreatedDate":"0001-01-01T00:00:00","DeletedAccessKeys":[{"AccessKeyTypeId":0,"Value":"String","Description":"String"}],"CreatedOrUpdatedAccessKeys":[{"AccessKeyTypeId":0,"Value":"String","Description":"String"}],"Firstname":"String","Lastname":"String","Email":"String","Phone":"String","ImageUrl":"String","CardId":"String","CustomFields":[{"Id":0,"Name":"String","Description":"String","Width":0,"DataType":"String","DefaultValue":"String","IsMandatory":false,"MandatoryErrorMessage":"String","MaxLength":0,"MultipleLineText":false,"RegEx":"String","RegExErrorMessage":"String","Values":[{"Value":"String"}]}],"CustomFieldValues":[{"Id":0,"Column":"String","Name":"String","Description":"String","Value":"String","DataType":"String"}],"Comments":[{"Id":0,"Comments":"String"}],"AccessKeys":[{"AccessKeyTypeId":0,"Value":"String","Description":"String"}],"PinCode":"String","ResponseStatus":{},"SubscribedToNewsletter":false}