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
CreateArticle Parameters:
NameParameterData TypeRequiredDescription
CompanyIdbodyGuid?No
NamebodystringYes
ArticleTypeIdbodyintYes
DescriptionbodystringYes
ImageUrlbodyUriNo
ActivebodyboolYes
AmountbodyintYes
PricebodydoubleYes.
CurrencyIdbodystringYesThe payment currency id
ServiceIdsqueryint[]NoQuery for specific services.
ArticleResponse Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuidNo
IdformintNo
NameformstringNo
ArticleTypeIdformintNo
DescriptionformstringNo
ImageUrlformstringNo
ActiveformboolNo
AmountformintNo
PriceformdoubleNo
CurrencyIdformstringNo
UpdatedDateformDateTimeNo
CreatedDateformDateTimeNo
ServicesformList<ArticleServiceRelation>No
ServiceIdsformList<int>No
PriceSignformstringNo
ArticleServiceRelation Parameters:
NameParameterData TypeRequiredDescription
CompanyIdformGuidYes
IdformintNo
ServiceIdformintYes
ArticleIdformintYes

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
}