BokaMera.API.Host

<back to all web services

DeleteCustomField

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
DELETE/customfields/{Id}Delete a custom fieldDelete a custom field for the currently logged in user, only administrators are allowed to delete custom fields.

export class CustomFieldLookupResponse
{
    public Id?: number;
    public Active?: boolean;
    public SortOrder?: number;
    public Value: string;

    public constructor(init?: Partial<CustomFieldLookupResponse>) { (Object as any).assign(this, init); }
}

export class CustomFieldServices
{
    public Id: number;
    /** @description Name of the service */
    // @ApiMember(Description="Name of the service")
    public Name: string;

    /** @description The image url of the service */
    // @ApiMember(Description="The image url of the service")
    public ImageUrl: string;

    public constructor(init?: Partial<CustomFieldServices>) { (Object as any).assign(this, init); }
}

export class CustomFieldQueryResponse
{
    /** @description Custom field id */
    // @ApiMember(Description="Custom field id")
    public Id: number;

    /** @description Reference to company that owns the custom field configuration */
    // @ApiMember(Description="Reference to company that owns the custom field configuration")
    public CompanyId: string;

    /** @description Group id */
    // @ApiMember(Description="Group id")
    public GroupId?: number;

    /** @description Field id */
    // @ApiMember(Description="Field id")
    public FieldId: number;

    /** @description Configuration name. Example: 'Number of persons'. */
    // @ApiMember(Description="Configuration name. Example: 'Number of persons'.")
    public Name: string;

    /** @description Field width. Example: 20 */
    // @ApiMember(Description="Field width. Example: 20")
    public Width: number;

    /** @description Column in database where to store the information. Example: 'TextField1' */
    // @ApiMember(Description="Column in database where to store the information. Example: 'TextField1'")
    public Column: string;

    /** @description Custom field description. Example: 'For how many persons is this booking?' */
    // @ApiMember(Description="Custom field description. Example: 'For how many persons is this booking?'")
    public Description: string;

    /** @description Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox' */
    // @ApiMember(Description="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'")
    public DataType: string;

    /** @description Default value of the field. Example: '3' */
    // @ApiMember(Description="Default value of the field. Example: '3'")
    public DefaultValue: string;

    /** @description Determines if the field is required to have a value or not */
    // @ApiMember(Description="Determines if the field is required to have a value or not")
    public IsMandatory: boolean;

    /** @description Error message shown to the user if the field data is required but not entered */
    // @ApiMember(Description="Error message shown to the user if the field data is required but not entered")
    public MandatoryErrorMessage: string;

    /** @description Max lenght of the field */
    // @ApiMember(Description="Max lenght of the field")
    public MaxLength: number;

    /** @description If the field should have multiple lines */
    // @ApiMember(Description="If the field should have multiple lines")
    public MultipleLineText: boolean;

    /** @description Regular expression used for validation of the field */
    // @ApiMember(Description="Regular expression used for validation of the field")
    public RegEx: string;

    /** @description Regular expression id for validation of the field */
    // @ApiMember(Description="Regular expression id for validation of the field")
    public RegExId?: number;

    /** @description Error message shown if the regular expression validation failed */
    // @ApiMember(Description="Error message shown if the regular expression validation failed")
    public RegExErrorMessage: string;

    /** @description If the field is visible to the customer */
    // @ApiMember(Description="If the field is visible to the customer")
    public IsPublic: boolean;

    /** @description If the field should be hidden in lists */
    // @ApiMember(Description="If the field should be hidden in lists")
    public IsHidden: boolean;

    /** @description Table to which the field belongs */
    // @ApiMember(Description="Table to which the field belongs")
    public Table: string;

    /** @description The values to select from if Datatype is DropDown for this custom field */
    // @ApiMember(Description="The values to select from if Datatype is DropDown for this custom field")
    public Values: CustomFieldLookupResponse[];

    /** @description The services that is connected to the custom field */
    // @ApiMember(Description="The services that is connected to the custom field")
    public Services: CustomFieldServices[];

    public constructor(init?: Partial<CustomFieldQueryResponse>) { (Object as any).assign(this, init); }
}

// @ValidateRequest(Validator="IsAuthenticated")
export class DeleteCustomField implements ICompany
{
    /** @description The company id, if empty will use the company id for the user you are logged in with. */
    // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
    public CompanyId?: string;

    /** @description Id of the custom field to delete */
    // @ApiMember(Description="Id of the custom field to delete", IsRequired=true, ParameterType="path")
    public Id: number;

    public constructor(init?: Partial<DeleteCustomField>) { (Object as any).assign(this, init); }
}

TypeScript DeleteCustomField DTOs

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

HTTP + 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: testapi.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>