Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
PUT | /customfields/{Id} | Update a custom field | Creates a new custom field, if an admin user is making the request, the user will be associated with the admin user's company. |
---|
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | path | int | Yes | Custom field id |
CompanyId | body | Guid? | No | The company id, if empty will use the company id for the user you are logged in with. |
GroupId | body | int? | No | Group id |
FieldId | body | int | No | Field id |
Name | body | string | Yes | Configuration name. Example: 'Number of persons'. |
Description | body | string | Yes | Custom field description. Example: 'For how many persons is this booking?' |
IconId | body | int | Yes | Custom 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' |
Width | body | int | No | Field width. Example: 20 |
Datatype | body | string | No | Data field of custom field. Valid values are: TextBox, DropDown Example: 'TextBox' |
DefaultValue | body | string | No | Default value of the field. Example: '3' |
IsMandatory | body | bool? | No | Determines if the field is required to have a value or not. Default is false |
MandatoryErrorMessage | body | string | No | Error message shown to the user if the field data is required but not entered |
MaxLength | body | int | Yes | Max lenght of the field. Default is 500 |
MultipleLineText | body | bool? | No | If the field should have multiple lines. Defualt is false |
RegExId | body | int? | No | Regular expression used for validation of the field |
RegExErrorMessage | body | string | No | Error message shown if the regular expression validation failed |
IsPublic | body | bool? | No | If the field is visible to the customer. Default is true |
IsHidden | body | bool? | No | If the field should be hidden in lists. Default is false |
Values | body | List<CustomFieldGroupValue> | No | The values to select from if Datatype is DropDown for this custom field |
Services | body | List<CustomFieldServices> | No | The services that is connected to the custom field. If null it will be connected to all services. |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
SortOrder | form | short? | No | |
Value | form | string | No |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | int | No | |
Name | form | string | No | Name of the service |
ImageUrl | form | Uri | No | The image url of the service |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | int | No | Custom field id |
CompanyId | form | Guid | No | Reference to company that owns the custom field configuration |
GroupId | form | int? | No | Group id |
FieldId | form | int | No | Field id |
Name | form | string | No | Configuration name. Example: 'Number of persons'. |
Width | form | int | No | Field width. Example: 20 |
Column | form | string | No | Column in database where to store the information. Example: 'TextField1' |
Description | form | string | No | Custom field description. Example: 'For how many persons is this booking?' |
DataType | form | string | No | Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' |
DefaultValue | form | string | No | Default value of the field. Example: '3' |
IsMandatory | form | bool | No | Determines if the field is required to have a value or not |
MandatoryErrorMessage | form | string | No | Error message shown to the user if the field data is required but not entered |
MaxLength | form | int | No | Max lenght of the field |
MultipleLineText | form | bool | No | If the field should have multiple lines |
RegEx | form | string | No | Regular expression used for validation of the field |
RegExId | form | int? | No | Regular expression id for validation of the field |
RegExErrorMessage | form | string | No | Error message shown if the regular expression validation failed |
IsPublic | form | bool | No | If the field is visible to the customer |
IsHidden | form | bool | No | If the field should be hidden in lists |
Table | form | string | No | Table to which the field belongs |
Values | form | List<CustomFieldLookupResponse> | No | The values to select from if Datatype is DropDown for this custom field |
Services | form | List<CustomFieldServices> | No | The services that is connected to the custom field |
Name | Parameter | Data Type | Required | Description |
---|---|---|---|---|
Id | form | int? | No | |
Active | form | bool? | No | |
SortOrder | form | int? | No | |
Value | form | string | No |
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
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: api.bokamera.se
Accept: text/jsv
Content-Type: text/jsv
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/jsv 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 } ] }