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.
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos

Namespace Global

    Namespace BokaMera.API.ServiceModel.Dtos

        Public Partial Class CustomFieldLookupResponse
            Public Overridable Property Id As Nullable(Of Integer)
            Public Overridable Property Active As Nullable(Of Boolean)
            Public Overridable Property SortOrder As Nullable(Of Integer)
            Public Overridable Property Value As String
        End Class

        Public Partial Class CustomFieldQueryResponse
            Public Sub New()
                Values = New List(Of CustomFieldLookupResponse)
                Services = New List(Of CustomFieldServices)
            End Sub

            '''<Summary>
            '''Custom field id
            '''</Summary>
            <ApiMember(Description:="Custom field id")>
            Public Overridable Property Id As Integer

            '''<Summary>
            '''Reference to company that owns the custom field configuration
            '''</Summary>
            <ApiMember(Description:="Reference to company that owns the custom field configuration")>
            Public Overridable Property CompanyId As Guid

            '''<Summary>
            '''Group id
            '''</Summary>
            <ApiMember(Description:="Group id")>
            Public Overridable Property GroupId As Nullable(Of Integer)

            '''<Summary>
            '''Field id
            '''</Summary>
            <ApiMember(Description:="Field id")>
            Public Overridable Property FieldId As Integer

            '''<Summary>
            '''Configuration name. Example: 'Number of persons'.
            '''</Summary>
            <ApiMember(Description:="Configuration name. Example: 'Number of persons'.")>
            Public Overridable Property Name As String

            '''<Summary>
            '''Field width. Example: 20
            '''</Summary>
            <ApiMember(Description:="Field width. Example: 20")>
            Public Overridable Property Width As Integer

            '''<Summary>
            '''Column in database where to store the information. Example: 'TextField1'
            '''</Summary>
            <ApiMember(Description:="Column in database where to store the information. Example: 'TextField1'")>
            Public Overridable Property Column As String

            '''<Summary>
            '''Custom field description. Example: 'For how many persons is this booking?'
            '''</Summary>
            <ApiMember(Description:="Custom field description. Example: 'For how many persons is this booking?'")>
            Public Overridable Property Description As String

            '''<Summary>
            '''Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'
            '''</Summary>
            <ApiMember(Description:="Data field of custom field. Valid values are: TextBox, ... Example: 'TextBox'")>
            Public Overridable Property DataType As String

            '''<Summary>
            '''Default value of the field. Example: '3'
            '''</Summary>
            <ApiMember(Description:="Default value of the field. Example: '3'")>
            Public Overridable Property DefaultValue As String

            '''<Summary>
            '''Determines if the field is required to have a value or not
            '''</Summary>
            <ApiMember(Description:="Determines if the field is required to have a value or not")>
            Public Overridable Property IsMandatory As Boolean

            '''<Summary>
            '''Error message shown to the user if the field data is required but not entered
            '''</Summary>
            <ApiMember(Description:="Error message shown to the user if the field data is required but not entered")>
            Public Overridable Property MandatoryErrorMessage As String

            '''<Summary>
            '''Max lenght of the field
            '''</Summary>
            <ApiMember(Description:="Max lenght of the field")>
            Public Overridable Property MaxLength As Integer

            '''<Summary>
            '''If the field should have multiple lines
            '''</Summary>
            <ApiMember(Description:="If the field should have multiple lines")>
            Public Overridable Property MultipleLineText As Boolean

            '''<Summary>
            '''Regular expression used for validation of the field
            '''</Summary>
            <ApiMember(Description:="Regular expression used for validation of the field")>
            Public Overridable Property RegEx As String

            '''<Summary>
            '''Regular expression id for validation of the field
            '''</Summary>
            <ApiMember(Description:="Regular expression id for validation of the field")>
            Public Overridable Property RegExId As Nullable(Of Integer)

            '''<Summary>
            '''Error message shown if the regular expression validation failed
            '''</Summary>
            <ApiMember(Description:="Error message shown if the regular expression validation failed")>
            Public Overridable Property RegExErrorMessage As String

            '''<Summary>
            '''If the field is visible to the customer
            '''</Summary>
            <ApiMember(Description:="If the field is visible to the customer")>
            Public Overridable Property IsPublic As Boolean

            '''<Summary>
            '''If the field should be hidden in lists
            '''</Summary>
            <ApiMember(Description:="If the field should be hidden in lists")>
            Public Overridable Property IsHidden As Boolean

            '''<Summary>
            '''Table to which the field belongs
            '''</Summary>
            <ApiMember(Description:="Table to which the field belongs")>
            Public Overridable Property Table As String

            '''<Summary>
            '''The values to select from if Datatype is DropDown for this custom field
            '''</Summary>
            <ApiMember(Description:="The values to select from if Datatype is DropDown for this custom field")>
            Public Overridable Property Values As List(Of CustomFieldLookupResponse)

            '''<Summary>
            '''The services that is connected to the custom field
            '''</Summary>
            <ApiMember(Description:="The services that is connected to the custom field")>
            Public Overridable Property Services As List(Of CustomFieldServices)
        End Class

        Public Partial Class CustomFieldServices
            Public Overridable Property Id As Integer
            '''<Summary>
            '''Name of the service
            '''</Summary>
            <ApiMember(Description:="Name of the service")>
            Public Overridable Property Name As String

            '''<Summary>
            '''The image url of the service
            '''</Summary>
            <ApiMember(Description:="The image url of the service")>
            Public Overridable Property ImageUrl As Uri
        End Class

        <ValidateRequest(Validator:="IsAuthenticated")>
        Public Partial Class DeleteCustomField
            Implements ICompany
            '''<Summary>
            '''The company id, if empty will use the company id for the user you are logged in with.
            '''</Summary>
            <ApiMember(Description:="The company id, if empty will use the company id for the user you are logged in with.")>
            Public Overridable Property CompanyId As Nullable(Of Guid)

            '''<Summary>
            '''Id of the custom field to delete
            '''</Summary>
            <ApiMember(Description:="Id of the custom field to delete", IsRequired:=true, ParameterType:="path")>
            Public Overridable Property Id As Integer
        End Class
    End Namespace
End Namespace

VB.NET 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>