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
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class CreateArticle
    {
        /**
        * 
        */
        @ApiMember(Description="")
        public UUID CompanyId = null;

        /**
        * 
        */
        @ApiMember(Description="", IsRequired=true)
        public String Name = null;

        /**
        * 
        */
        @ApiMember(Description="", IsRequired=true)
        public Integer ArticleTypeId = null;

        /**
        * 
        */
        @ApiMember(Description="", IsRequired=true)
        public String Description = null;

        /**
        * 
        */
        @ApiMember(Description="")
        public Uri ImageUrl = null;

        /**
        * 
        */
        @ApiMember(Description="", IsRequired=true)
        public Boolean Active = null;

        /**
        * 
        */
        @ApiMember(Description="", IsRequired=true)
        public Integer Amount = null;

        /**
        * .
        */
        @ApiMember(Description=".", IsRequired=true)
        public Double Price = null;

        /**
        * The payment currency id
        */
        @ApiMember(Description="The payment currency id", IsRequired=true)
        public String CurrencyId = null;

        /**
        * Query for specific services.
        */
        @ApiMember(Description="Query for specific services.", ParameterType="query")
        public ArrayList<Integer> ServiceIds = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public CreateArticle setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public String getName() { return Name; }
        public CreateArticle setName(String value) { this.Name = value; return this; }
        public Integer getArticleTypeId() { return ArticleTypeId; }
        public CreateArticle setArticleTypeId(Integer value) { this.ArticleTypeId = value; return this; }
        public String getDescription() { return Description; }
        public CreateArticle setDescription(String value) { this.Description = value; return this; }
        public Uri getImageUrl() { return ImageUrl; }
        public CreateArticle setImageUrl(Uri value) { this.ImageUrl = value; return this; }
        public Boolean isActive() { return Active; }
        public CreateArticle setActive(Boolean value) { this.Active = value; return this; }
        public Integer getAmount() { return Amount; }
        public CreateArticle setAmount(Integer value) { this.Amount = value; return this; }
        public Double getPrice() { return Price; }
        public CreateArticle setPrice(Double value) { this.Price = value; return this; }
        public String getCurrencyId() { return CurrencyId; }
        public CreateArticle setCurrencyId(String value) { this.CurrencyId = value; return this; }
        public ArrayList<Integer> getServiceIds() { return ServiceIds; }
        public CreateArticle setServiceIds(ArrayList<Integer> value) { this.ServiceIds = value; return this; }
    }

    public static class ArticleResponse
    {
        public UUID CompanyId = null;
        public Integer Id = null;
        public String Name = null;
        public Integer ArticleTypeId = null;
        public String Description = null;
        public String ImageUrl = null;
        public Boolean Active = null;
        public Integer Amount = null;
        public Double Price = null;
        public String CurrencyId = null;
        public Date UpdatedDate = null;
        public Date CreatedDate = null;
        public ArrayList<ArticleServiceDb> Services = null;
        public ArrayList<Integer> ServiceIds = null;
        public String PriceSign = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public ArticleResponse setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getId() { return Id; }
        public ArticleResponse setId(Integer value) { this.Id = value; return this; }
        public String getName() { return Name; }
        public ArticleResponse setName(String value) { this.Name = value; return this; }
        public Integer getArticleTypeId() { return ArticleTypeId; }
        public ArticleResponse setArticleTypeId(Integer value) { this.ArticleTypeId = value; return this; }
        public String getDescription() { return Description; }
        public ArticleResponse setDescription(String value) { this.Description = value; return this; }
        public String getImageUrl() { return ImageUrl; }
        public ArticleResponse setImageUrl(String value) { this.ImageUrl = value; return this; }
        public Boolean isActive() { return Active; }
        public ArticleResponse setActive(Boolean value) { this.Active = value; return this; }
        public Integer getAmount() { return Amount; }
        public ArticleResponse setAmount(Integer value) { this.Amount = value; return this; }
        public Double getPrice() { return Price; }
        public ArticleResponse setPrice(Double value) { this.Price = value; return this; }
        public String getCurrencyId() { return CurrencyId; }
        public ArticleResponse setCurrencyId(String value) { this.CurrencyId = value; return this; }
        public Date getUpdatedDate() { return UpdatedDate; }
        public ArticleResponse setUpdatedDate(Date value) { this.UpdatedDate = value; return this; }
        public Date getCreatedDate() { return CreatedDate; }
        public ArticleResponse setCreatedDate(Date value) { this.CreatedDate = value; return this; }
        public ArrayList<ArticleServiceDb> getServices() { return Services; }
        public ArticleResponse setServices(ArrayList<ArticleServiceDb> value) { this.Services = value; return this; }
        public ArrayList<Integer> getServiceIds() { return ServiceIds; }
        public ArticleResponse setServiceIds(ArrayList<Integer> value) { this.ServiceIds = value; return this; }
        public String getPriceSign() { return PriceSign; }
        public ArticleResponse setPriceSign(String value) { this.PriceSign = value; return this; }
    }

    public static class ArticleServiceDb extends BaseModel
    {
        @Required()
        public UUID CompanyId = null;

        public Integer Id = null;
        @Required()
        public Integer ServiceId = null;

        @Required()
        public Integer ArticleId = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public ArticleServiceDb setCompanyId(UUID value) { this.CompanyId = value; return this; }
        public Integer getId() { return Id; }
        public ArticleServiceDb setId(Integer value) { this.Id = value; return this; }
        public Integer getServiceId() { return ServiceId; }
        public ArticleServiceDb setServiceId(Integer value) { this.ServiceId = value; return this; }
        public Integer getArticleId() { return ArticleId; }
        public ArticleServiceDb setArticleId(Integer value) { this.ArticleId = value; return this; }
    }

    public static class BaseModel
    {
        
    }

}

Java CreateArticle DTOs

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

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<CreateArticle xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Active>false</Active>
  <Amount>0</Amount>
  <ArticleTypeId>0</ArticleTypeId>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <CurrencyId>String</CurrencyId>
  <Description>String</Description>
  <ImageUrl i:nil="true" />
  <Name>String</Name>
  <Price>0</Price>
  <ServiceIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>0</d2p1:int>
  </ServiceIds>
</CreateArticle>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ArticleResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <Active>false</Active>
  <Amount>0</Amount>
  <ArticleTypeId>0</ArticleTypeId>
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <CreatedDate>0001-01-01T00:00:00</CreatedDate>
  <CurrencyId>String</CurrencyId>
  <Description>String</Description>
  <Id>0</Id>
  <ImageUrl>String</ImageUrl>
  <Name>String</Name>
  <Price>0</Price>
  <PriceSign>String</PriceSign>
  <ServiceIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>0</d2p1:int>
  </ServiceIds>
  <Services xmlns:d2p1="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Db">
    <d2p1:ArticleServiceDb>
      <d2p1:ArticleId>0</d2p1:ArticleId>
      <d2p1:CompanyId>00000000-0000-0000-0000-000000000000</d2p1:CompanyId>
      <d2p1:Id>0</d2p1:Id>
      <d2p1:ServiceId>0</d2p1:ServiceId>
    </d2p1:ArticleServiceDb>
  </Services>
  <UpdatedDate>0001-01-01T00:00:00</UpdatedDate>
</ArticleResponse>