BokaMera.API.Host

<back to all web services

ArticleQuery

The following routes are available for this service:
GET/eaccounting/articles
import 'package:servicestack/servicestack.dart';

class BaseArticleDto implements IConvertible
{
    String? ArticleId;
    double? ArticlePrice;
    String? ArticleName;
    DateTime? CreatedDate;

    BaseArticleDto({this.ArticleId,this.ArticlePrice,this.ArticleName,this.CreatedDate});
    BaseArticleDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ArticleId = json['ArticleId'];
        ArticlePrice = JsonConverters.toDouble(json['ArticlePrice']);
        ArticleName = json['ArticleName'];
        CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ArticleId': ArticleId,
        'ArticlePrice': ArticlePrice,
        'ArticleName': ArticleName,
        'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!)
    };

    getTypeName() => "BaseArticleDto";
    TypeContext? context = _ctx;
}

class ArticleQueryResponse extends BaseArticleDto implements IConvertible
{
    String? UnitId;
    String? CodingId;
    String? VatRate;
    String? VatRatePercent;
    String? CurrencySign;

    ArticleQueryResponse({this.UnitId,this.CodingId,this.VatRate,this.VatRatePercent,this.CurrencySign});
    ArticleQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        UnitId = json['UnitId'];
        CodingId = json['CodingId'];
        VatRate = json['VatRate'];
        VatRatePercent = json['VatRatePercent'];
        CurrencySign = json['CurrencySign'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'UnitId': UnitId,
        'CodingId': CodingId,
        'VatRate': VatRate,
        'VatRatePercent': VatRatePercent,
        'CurrencySign': CurrencySign
    });

    getTypeName() => "ArticleQueryResponse";
    TypeContext? context = _ctx;
}

class ArticleQuery implements ICompany, IConvertible
{
    String? CompanyId;

    ArticleQuery({this.CompanyId});
    ArticleQuery.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId
    };

    getTypeName() => "ArticleQuery";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'BaseArticleDto': TypeInfo(TypeOf.Class, create:() => BaseArticleDto()),
    'ArticleQueryResponse': TypeInfo(TypeOf.Class, create:() => ArticleQueryResponse()),
    'ArticleQuery': TypeInfo(TypeOf.Class, create:() => ArticleQuery()),
});

Dart ArticleQuery 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.

GET /eaccounting/articles HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"UnitId":"String","CodingId":"String","VatRate":"String","VatRatePercent":"String","CurrencySign":"String","ArticlePrice":0,"ArticleName":"String"}