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.
namespace BokaMera.API.ServiceModel.Dtos

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type CustomFieldLookupResponse() = 
        member val Id:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val Active:Nullable<Boolean> = new Nullable<Boolean>() with get,set
        member val SortOrder:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val Value:String = null with get,set

    [<AllowNullLiteral>]
    type CustomFieldServices() = 
        member val Id:Int32 = new Int32() with get,set
        ///<summary>
        ///Name of the service
        ///</summary>
        [<ApiMember(Description="Name of the service")>]
        member val Name:String = null with get,set

        ///<summary>
        ///The image url of the service
        ///</summary>
        [<ApiMember(Description="The image url of the service")>]
        member val ImageUrl:Uri = null with get,set

    [<AllowNullLiteral>]
    type CustomFieldQueryResponse() = 
        ///<summary>
        ///Custom field id
        ///</summary>
        [<ApiMember(Description="Custom field id")>]
        member val Id:Int32 = new Int32() with get,set

        ///<summary>
        ///Reference to company that owns the custom field configuration
        ///</summary>
        [<ApiMember(Description="Reference to company that owns the custom field configuration")>]
        member val CompanyId:Guid = new Guid() with get,set

        ///<summary>
        ///Group id
        ///</summary>
        [<ApiMember(Description="Group id")>]
        member val GroupId:Nullable<Int32> = new Nullable<Int32>() with get,set

        ///<summary>
        ///Field id
        ///</summary>
        [<ApiMember(Description="Field id")>]
        member val FieldId:Int32 = new Int32() with get,set

        ///<summary>
        ///Configuration name. Example: 'Number of persons'.
        ///</summary>
        [<ApiMember(Description="Configuration name. Example: 'Number of persons'.")>]
        member val Name:String = null with get,set

        ///<summary>
        ///Field width. Example: 20
        ///</summary>
        [<ApiMember(Description="Field width. Example: 20")>]
        member val Width:Int32 = new Int32() with get,set

        ///<summary>
        ///Column in database where to store the information. Example: 'TextField1'
        ///</summary>
        [<ApiMember(Description="Column in database where to store the information. Example: 'TextField1'")>]
        member val Column:String = null with get,set

        ///<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?'")>]
        member val Description:String = null with get,set

        ///<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'")>]
        member val DataType:String = null with get,set

        ///<summary>
        ///Default value of the field. Example: '3'
        ///</summary>
        [<ApiMember(Description="Default value of the field. Example: '3'")>]
        member val DefaultValue:String = null with get,set

        ///<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")>]
        member val IsMandatory:Boolean = new Boolean() with get,set

        ///<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")>]
        member val MandatoryErrorMessage:String = null with get,set

        ///<summary>
        ///Max lenght of the field
        ///</summary>
        [<ApiMember(Description="Max lenght of the field")>]
        member val MaxLength:Int32 = new Int32() with get,set

        ///<summary>
        ///If the field should have multiple lines
        ///</summary>
        [<ApiMember(Description="If the field should have multiple lines")>]
        member val MultipleLineText:Boolean = new Boolean() with get,set

        ///<summary>
        ///Regular expression used for validation of the field
        ///</summary>
        [<ApiMember(Description="Regular expression used for validation of the field")>]
        member val RegEx:String = null with get,set

        ///<summary>
        ///Regular expression id for validation of the field
        ///</summary>
        [<ApiMember(Description="Regular expression id for validation of the field")>]
        member val RegExId:Nullable<Int32> = new Nullable<Int32>() with get,set

        ///<summary>
        ///Error message shown if the regular expression validation failed
        ///</summary>
        [<ApiMember(Description="Error message shown if the regular expression validation failed")>]
        member val RegExErrorMessage:String = null with get,set

        ///<summary>
        ///If the field is visible to the customer
        ///</summary>
        [<ApiMember(Description="If the field is visible to the customer")>]
        member val IsPublic:Boolean = new Boolean() with get,set

        ///<summary>
        ///If the field should be hidden in lists
        ///</summary>
        [<ApiMember(Description="If the field should be hidden in lists")>]
        member val IsHidden:Boolean = new Boolean() with get,set

        ///<summary>
        ///Table to which the field belongs
        ///</summary>
        [<ApiMember(Description="Table to which the field belongs")>]
        member val Table:String = null with get,set

        ///<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")>]
        member val Values:ResizeArray<CustomFieldLookupResponse> = new ResizeArray<CustomFieldLookupResponse>() with get,set

        ///<summary>
        ///The services that is connected to the custom field
        ///</summary>
        [<ApiMember(Description="The services that is connected to the custom field")>]
        member val Services:ResizeArray<CustomFieldServices> = new ResizeArray<CustomFieldServices>() with get,set

    [<ValidateRequest(Validator="IsAuthenticated")>]
    [<AllowNullLiteral>]
    type DeleteCustomField() = 
        ///<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.")>]
        member val CompanyId:Nullable<Guid> = new Nullable<Guid>() with get,set

        ///<summary>
        ///Id of the custom field to delete
        ///</summary>
        [<ApiMember(Description="Id of the custom field to delete", IsRequired=true, ParameterType="path")>]
        member val Id:Int32 = new Int32() with get,set

F# DeleteCustomField DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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/json
HTTP/1.1 200 OK
Content-Type: application/json
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"}]}