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. |
---|
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
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"}]}