Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
DELETE | /customfields/{Id} | Delete a custom field | Delete a custom field for the currently logged in user, only administrators are allowed to delete custom fields. |
---|
"use strict";
export class CustomFieldLookupResponse {
/** @param {{Id?:number,Active?:boolean,SortOrder?:number,Value?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {?number} */
Id;
/** @type {?boolean} */
Active;
/** @type {?number} */
SortOrder;
/** @type {string} */
Value;
}
export class CustomFieldServices {
/** @param {{Id?:number,Name?:string,ImageUrl?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Id;
/**
* @type {string}
* @description Name of the service */
Name;
/**
* @type {string}
* @description The image url of the service */
ImageUrl;
}
export class CustomFieldQueryResponse {
/** @param {{Id?:number,CompanyId?:string,GroupId?:number,FieldId?:number,Name?:string,Width?:number,Column?:string,Description?:string,DataType?:string,DefaultValue?:string,IsMandatory?:boolean,MandatoryErrorMessage?:string,MaxLength?:number,MultipleLineText?:boolean,RegEx?:string,RegExId?:number,RegExErrorMessage?:string,IsPublic?:boolean,IsHidden?:boolean,Table?:string,Values?:CustomFieldLookupResponse[],Services?:CustomFieldServices[]}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {number}
* @description Custom field id */
Id;
/**
* @type {string}
* @description Reference to company that owns the custom field configuration */
CompanyId;
/**
* @type {?number}
* @description Group id */
GroupId;
/**
* @type {number}
* @description Field id */
FieldId;
/**
* @type {string}
* @description Configuration name. Example: 'Number of persons'. */
Name;
/**
* @type {number}
* @description Field width. Example: 20 */
Width;
/**
* @type {string}
* @description Column in database where to store the information. Example: 'TextField1' */
Column;
/**
* @type {string}
* @description Custom field description. Example: 'For how many persons is this booking?' */
Description;
/**
* @type {string}
* @description Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' */
DataType;
/**
* @type {string}
* @description Default value of the field. Example: '3' */
DefaultValue;
/**
* @type {boolean}
* @description Determines if the field is required to have a value or not */
IsMandatory;
/**
* @type {string}
* @description Error message shown to the user if the field data is required but not entered */
MandatoryErrorMessage;
/**
* @type {number}
* @description Max lenght of the field */
MaxLength;
/**
* @type {boolean}
* @description If the field should have multiple lines */
MultipleLineText;
/**
* @type {string}
* @description Regular expression used for validation of the field */
RegEx;
/**
* @type {?number}
* @description Regular expression id for validation of the field */
RegExId;
/**
* @type {string}
* @description Error message shown if the regular expression validation failed */
RegExErrorMessage;
/**
* @type {boolean}
* @description If the field is visible to the customer */
IsPublic;
/**
* @type {boolean}
* @description If the field should be hidden in lists */
IsHidden;
/**
* @type {string}
* @description Table to which the field belongs */
Table;
/**
* @type {CustomFieldLookupResponse[]}
* @description The values to select from if Datatype is DropDown for this custom field */
Values;
/**
* @type {CustomFieldServices[]}
* @description The services that is connected to the custom field */
Services;
}
export class DeleteCustomField {
/** @param {{CompanyId?:string,Id?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {?string}
* @description The company id, if empty will use the company id for the user you are logged in with. */
CompanyId;
/**
* @type {number}
* @description Id of the custom field to delete */
Id;
}
JavaScript DeleteCustomField DTOs
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.
DELETE /customfields/{Id} HTTP/1.1 Host: api.bokamera.se Accept: application/xml
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>