BokaMera.API.Host

<back to all web services

UpdateCustomField

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
PUT/customfields/{Id}Update a custom fieldCreates a new custom field, if an admin user is making the request, the user will be associated with the admin user's company.
UpdateCustomField Parameters:
NameParameterData TypeRequiredDescription
IdpathintYesCustom field id
CompanyIdbodyGuid?NoThe company id, if empty will use the company id for the user you are logged in with.
GroupIdbodyint?NoGroup id
FieldIdbodyintNoField id
NamebodystringYesConfiguration name. Example: 'Number of persons'.
DescriptionbodystringYesCustom field description. Example: 'For how many persons is this booking?'
IconIdbodyintYesCustom field icon id. Example: '1 House,2 Calendar,3 Building,4 Cart,5 Find,6 Blue flag,7 Green flag,8 Information,9 Lightning,10 Page edit,11 Pencil,12 Link,13 Star,14 User,15 Tick,16 Wrench,17 Clock'
WidthbodyintNoField width. Example: 20
DatatypebodystringNoData field of custom field. Valid values are: TextBox, DropDown Example: 'TextBox'
DefaultValuebodystringNoDefault value of the field. Example: '3'
IsMandatorybodybool?NoDetermines if the field is required to have a value or not. Default is false
MandatoryErrorMessagebodystringNoError message shown to the user if the field data is required but not entered
MaxLengthbodyintYesMax lenght of the field. Default is 500
MultipleLineTextbodybool?NoIf the field should have multiple lines. Defualt is false
RegExIdbodyint?NoRegular expression used for validation of the field
RegExErrorMessagebodystringNoError message shown if the regular expression validation failed
IsPublicbodybool?NoIf the field is visible to the customer. Default is true
IsHiddenbodybool?NoIf the field should be hidden in lists. Default is false
ValuesbodyList<CustomFieldGroupValue>NoThe values to select from if Datatype is DropDown for this custom field
ServicesbodyList<CustomFieldServices>NoThe services that is connected to the custom field. If null it will be connected to all services.
CustomFieldGroupValue Parameters:
NameParameterData TypeRequiredDescription
SortOrderformshort?No
ValueformstringNo
CustomFieldServices Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
NameformstringNoName of the service
ImageUrlformUriNoThe image url of the service
CustomFieldQueryResponse Parameters:
NameParameterData TypeRequiredDescription
IdformintNoCustom field id
CompanyIdformGuidNoReference to company that owns the custom field configuration
GroupIdformint?NoGroup id
FieldIdformintNoField id
NameformstringNoConfiguration name. Example: 'Number of persons'.
WidthformintNoField width. Example: 20
ColumnformstringNoColumn in database where to store the information. Example: 'TextField1'
DescriptionformstringNoCustom field description. Example: 'For how many persons is this booking?'
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
RegExIdformint?NoRegular expression id for validation of the field
RegExErrorMessageformstringNoError message shown if the regular expression validation failed
IsPublicformboolNoIf the field is visible to the customer
IsHiddenformboolNoIf the field should be hidden in lists
TableformstringNoTable to which the field belongs
ValuesformList<CustomFieldLookupResponse>NoThe values to select from if Datatype is DropDown for this custom field
ServicesformList<CustomFieldServices>NoThe services that is connected to the custom field
CustomFieldLookupResponse Parameters:
NameParameterData TypeRequiredDescription
Idformint?No
Activeformbool?No
SortOrderformint?No
ValueformstringNo

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

HTTP + OTHER

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

PUT /customfields/{Id} HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"Id":0,"CompanyId":"00000000-0000-0000-0000-000000000000","GroupId":0,"FieldId":0,"Name":"String","Description":"String","IconId":0,"Width":0,"Datatype":"String","DefaultValue":"String","IsMandatory":false,"MandatoryErrorMessage":"String","MaxLength":0,"MultipleLineText":false,"RegExId":0,"RegExErrorMessage":"String","IsPublic":false,"IsHidden":false,"Values":[{"SortOrder":0,"Value":"String"}],"Services":[{"Id":0,"Name":"String"}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Id":0,"GroupId":0,"FieldId":0,"Name":"String","Width":0,"Column":"String","Description":"String","DataType":"String","DefaultValue":"String","IsMandatory":false,"MandatoryErrorMessage":"String","MaxLength":0,"MultipleLineText":false,"RegEx":"String","RegExId":0,"RegExErrorMessage":"String","IsPublic":false,"IsHidden":false,"Table":"String","Values":[{"Id":0,"Active":false,"SortOrder":0,"Value":"String"}],"Services":[{"Id":0,"Name":"String"}]}