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

export class ArticleResponse
{
    public CompanyId: string;
    public Id: number;
    public Name: string;
    public ArticleTypeId: number;
    public Description: string;
    public ImageUrl: string;
    public Active: boolean;
    public Amount: number;
    public Price: number;
    public CurrencyId: string;
    public UpdatedDate: string;
    public CreatedDate: string;
    public ModifiedDate?: string;

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

export class CreateArticle
{
    /** @description  */
    // @ApiMember(Description="")
    public CompanyId?: string;

    /** @description  */
    // @ApiMember(Description="")
    public Name: string;

    /** @description  */
    // @ApiMember(Description="", IsRequired=true)
    public ArticleTypeId: number;

    /** @description  */
    // @ApiMember(Description="")
    public Description: string;

    /** @description  */
    // @ApiMember(Description="")
    public ImageUrl: string;

    /** @description  */
    // @ApiMember(Description="", IsRequired=true)
    public Active: boolean;

    /** @description  */
    // @ApiMember(Description="", IsRequired=true)
    public Amount: number;

    /** @description . */
    // @ApiMember(Description=".", IsRequired=true)
    public Price: number;

    /** @description The payment currency id */
    // @ApiMember(Description="The payment currency id", IsRequired=true)
    public CurrencyId: string;

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

TypeScript 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: testapi.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	CompanyId: 00000000-0000-0000-0000-000000000000,
	Name: String,
	ArticleTypeId: 0,
	Description: String,
	ImageUrl: String,
	Active: False,
	Amount: 0,
	Price: 0,
	CurrencyId: String
}
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,
	ModifiedDate: 0001-01-01T00:00:00.0000000+00:00
}