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 .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<UpdateCustomField xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<Datatype>String</Datatype>
<DefaultValue>String</DefaultValue>
<Description>String</Description>
<FieldId>0</FieldId>
<GroupId>0</GroupId>
<IconId>0</IconId>
<Id>0</Id>
<IsHidden>false</IsHidden>
<IsMandatory>false</IsMandatory>
<IsPublic>false</IsPublic>
<MandatoryErrorMessage>String</MandatoryErrorMessage>
<MaxLength>0</MaxLength>
<MultipleLineText>false</MultipleLineText>
<Name>String</Name>
<RegExErrorMessage>String</RegExErrorMessage>
<RegExId>0</RegExId>
<Services>
<CustomFieldServices>
<Id>0</Id>
<ImageUrl i:nil="true" />
<Name>String</Name>
</CustomFieldServices>
</Services>
<Values>
<CustomFieldGroupValue>
<SortOrder>0</SortOrder>
<Value>String</Value>
</CustomFieldGroupValue>
</Values>
<Width>0</Width>
</UpdateCustomField>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CustomFieldQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <Column>String</Column> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <DataType>String</DataType> <DefaultValue>String</DefaultValue> <Description>String</Description> <FieldId>0</FieldId> <GroupId>0</GroupId> <Id>0</Id> <IsHidden>false</IsHidden> <IsMandatory>false</IsMandatory> <IsPublic>false</IsPublic> <MandatoryErrorMessage>String</MandatoryErrorMessage> <MaxLength>0</MaxLength> <MultipleLineText>false</MultipleLineText> <Name>String</Name> <RegEx>String</RegEx> <RegExErrorMessage>String</RegExErrorMessage> <RegExId>0</RegExId> <Services> <CustomFieldServices> <Id>0</Id> <ImageUrl i:nil="true" /> <Name>String</Name> </CustomFieldServices> </Services> <Table>String</Table> <Values> <CustomFieldLookupResponse> <Active>false</Active> <Id>0</Id> <SortOrder>0</SortOrder> <Value>String</Value> </CustomFieldLookupResponse> </Values> <Width>0</Width> </CustomFieldQueryResponse>