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 .other suffix or ?format=other
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: text/jsonl
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"}]}