BokaMera.API.Host

<back to all web services

CreateArticle

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
POST/articlesAdd new articleAdd article to the company for the currently logged in user
namespace BokaMera.API.ServiceModel.Db

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

    [<AllowNullLiteral>]
    type BaseModel() = 
        class end

    [<AllowNullLiteral>]
    type ArticleServiceRelation() = 
        inherit BaseModel()
        [<Required>]
        member val CompanyId:Guid = new Guid() with get,set

        member val Id:Int32 = new Int32() with get,set
        [<Required>]
        member val ServiceId:Int32 = new Int32() with get,set

        [<Required>]
        member val ArticleId:Int32 = new Int32() with get,set

    [<AllowNullLiteral>]
    type ArticleResponse() = 
        member val CompanyId:Guid = new Guid() with get,set
        member val Id:Int32 = new Int32() with get,set
        member val Name:String = null with get,set
        member val ArticleTypeId:Int32 = new Int32() with get,set
        member val Description:String = null with get,set
        member val ImageUrl:String = null with get,set
        member val Active:Boolean = new Boolean() with get,set
        member val Amount:Int32 = new Int32() with get,set
        member val Price:Double = new Double() with get,set
        member val CurrencyId:String = null with get,set
        member val UpdatedDate:DateTime = new DateTime() with get,set
        member val CreatedDate:DateTime = new DateTime() with get,set
        member val Services:ResizeArray<ArticleServiceRelation> = new ResizeArray<ArticleServiceRelation>() with get,set
        member val ServiceIds:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val PriceSign:String = null with get,set

    [<AllowNullLiteral>]
    type CreateArticle() = 
        ///<summary>
        ///
        ///</summary>
        [<ApiMember(Description="")>]
        member val CompanyId:Nullable<Guid> = new Nullable<Guid>() with get,set

        ///<summary>
        ///
        ///</summary>
        [<ApiMember(Description="", IsRequired=true)>]
        member val Name:String = null with get,set

        ///<summary>
        ///
        ///</summary>
        [<ApiMember(Description="", IsRequired=true)>]
        member val ArticleTypeId:Int32 = new Int32() with get,set

        ///<summary>
        ///
        ///</summary>
        [<ApiMember(Description="", IsRequired=true)>]
        member val Description:String = null with get,set

        ///<summary>
        ///
        ///</summary>
        [<ApiMember(Description="")>]
        member val ImageUrl:Uri = null with get,set

        ///<summary>
        ///
        ///</summary>
        [<ApiMember(Description="", IsRequired=true)>]
        member val Active:Boolean = new Boolean() with get,set

        ///<summary>
        ///
        ///</summary>
        [<ApiMember(Description="", IsRequired=true)>]
        member val Amount:Int32 = new Int32() with get,set

        ///<summary>
        ///.
        ///</summary>
        [<ApiMember(Description=".", IsRequired=true)>]
        member val Price:Double = new Double() with get,set

        ///<summary>
        ///The payment currency id
        ///</summary>
        [<ApiMember(Description="The payment currency id", IsRequired=true)>]
        member val CurrencyId:String = null with get,set

        ///<summary>
        ///Query for specific services.
        ///</summary>
        [<ApiMember(Description="Query for specific services.", ParameterType="query")>]
        member val ServiceIds:Int32[] = [||] with get,set

F# CreateArticle DTOs

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

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /articles HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CompanyId: 00000000-0000-0000-0000-000000000000,
	Name: String,
	ArticleTypeId: 0,
	Description: String,
	Active: False,
	Amount: 0,
	Price: 0,
	CurrencyId: String,
	ServiceIds: 
	[
		0
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Id: 0,
	Name: String,
	ArticleTypeId: 0,
	Description: String,
	ImageUrl: String,
	Active: False,
	Amount: 0,
	Price: 0,
	CurrencyId: String,
	Services: 
	[
		{
			Id: 0,
			ServiceId: 0,
			ArticleId: 0
		}
	],
	ServiceIds: 
	[
		0
	],
	PriceSign: String
}