Trendsic Platform Service

<back to all web services

FormListRequest

Requires Authentication
The following routes are available for this service:
GET/v1/forms
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class FormStats implements IConvertible
{
    int? Total;
    int? NeedDecision;
    int? Waiting;
    int? Overdue;

    FormStats({this.Total,this.NeedDecision,this.Waiting,this.Overdue});
    FormStats.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Total = json['Total'];
        NeedDecision = json['NeedDecision'];
        Waiting = json['Waiting'];
        Overdue = json['Overdue'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Total': Total,
        'NeedDecision': NeedDecision,
        'Waiting': Waiting,
        'Overdue': Overdue
    };

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

class FormCard implements IConvertible
{
    String? FormUID;
    String? Name;
    String? Slug;
    String? Noun;
    String? NumberPrefix;
    String? Description;
    String? Tone;
    String? Status;
    int? PublishedVersionNo;
    DateTime? PublishedAt;
    String? PublishedBy;
    bool? DraftDirty;
    DateTime? DraftUpdatedAt;
    String? DraftUpdatedBy;
    String? PackLabel;
    String? SettingsJson;
    FormStats? Stats;
    List<String>? Offered = [];
    String? CreatedBy;
    DateTime? CreatedAt;
    DateTime? UpdatedAt;

    FormCard({this.FormUID,this.Name,this.Slug,this.Noun,this.NumberPrefix,this.Description,this.Tone,this.Status,this.PublishedVersionNo,this.PublishedAt,this.PublishedBy,this.DraftDirty,this.DraftUpdatedAt,this.DraftUpdatedBy,this.PackLabel,this.SettingsJson,this.Stats,this.Offered,this.CreatedBy,this.CreatedAt,this.UpdatedAt});
    FormCard.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FormUID = json['FormUID'];
        Name = json['Name'];
        Slug = json['Slug'];
        Noun = json['Noun'];
        NumberPrefix = json['NumberPrefix'];
        Description = json['Description'];
        Tone = json['Tone'];
        Status = json['Status'];
        PublishedVersionNo = json['PublishedVersionNo'];
        PublishedAt = JsonConverters.fromJson(json['PublishedAt'],'DateTime',context!);
        PublishedBy = json['PublishedBy'];
        DraftDirty = json['DraftDirty'];
        DraftUpdatedAt = JsonConverters.fromJson(json['DraftUpdatedAt'],'DateTime',context!);
        DraftUpdatedBy = json['DraftUpdatedBy'];
        PackLabel = json['PackLabel'];
        SettingsJson = json['SettingsJson'];
        Stats = JsonConverters.fromJson(json['Stats'],'FormStats',context!);
        Offered = JsonConverters.fromJson(json['Offered'],'List<String>',context!);
        CreatedBy = json['CreatedBy'];
        CreatedAt = JsonConverters.fromJson(json['CreatedAt'],'DateTime',context!);
        UpdatedAt = JsonConverters.fromJson(json['UpdatedAt'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FormUID': FormUID,
        'Name': Name,
        'Slug': Slug,
        'Noun': Noun,
        'NumberPrefix': NumberPrefix,
        'Description': Description,
        'Tone': Tone,
        'Status': Status,
        'PublishedVersionNo': PublishedVersionNo,
        'PublishedAt': JsonConverters.toJson(PublishedAt,'DateTime',context!),
        'PublishedBy': PublishedBy,
        'DraftDirty': DraftDirty,
        'DraftUpdatedAt': JsonConverters.toJson(DraftUpdatedAt,'DateTime',context!),
        'DraftUpdatedBy': DraftUpdatedBy,
        'PackLabel': PackLabel,
        'SettingsJson': SettingsJson,
        'Stats': JsonConverters.toJson(Stats,'FormStats',context!),
        'Offered': JsonConverters.toJson(Offered,'List<String>',context!),
        'CreatedBy': CreatedBy,
        'CreatedAt': JsonConverters.toJson(CreatedAt,'DateTime',context!),
        'UpdatedAt': JsonConverters.toJson(UpdatedAt,'DateTime',context!)
    };

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

class FormListResponse implements IConvertible
{
    List<FormCard>? Forms = [];
    ResponseStatus? ResponseStatus;

    FormListResponse({this.Forms,this.ResponseStatus});
    FormListResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Forms = JsonConverters.fromJson(json['Forms'],'List<FormCard>',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Forms': JsonConverters.toJson(Forms,'List<FormCard>',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class FormListRequest implements IConvertible
{
    FormListRequest();
    FormListRequest.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "FormListRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'FormStats': TypeInfo(TypeOf.Class, create:() => FormStats()),
    'FormCard': TypeInfo(TypeOf.Class, create:() => FormCard()),
    'FormListResponse': TypeInfo(TypeOf.Class, create:() => FormListResponse()),
    'List<FormCard>': TypeInfo(TypeOf.Class, create:() => <FormCard>[]),
    'FormListRequest': TypeInfo(TypeOf.Class, create:() => FormListRequest()),
});

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

GET /v1/forms HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<FormListResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Forms>
    <FormCard>
      <CreatedAt>0001-01-01T00:00:00</CreatedAt>
      <CreatedBy>String</CreatedBy>
      <Description>String</Description>
      <DraftDirty>false</DraftDirty>
      <DraftUpdatedAt>0001-01-01T00:00:00</DraftUpdatedAt>
      <DraftUpdatedBy>String</DraftUpdatedBy>
      <FormUID>00000000-0000-0000-0000-000000000000</FormUID>
      <Name>String</Name>
      <Noun>String</Noun>
      <NumberPrefix>String</NumberPrefix>
      <Offered xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </Offered>
      <PackLabel>String</PackLabel>
      <PublishedAt>0001-01-01T00:00:00</PublishedAt>
      <PublishedBy>String</PublishedBy>
      <PublishedVersionNo>0</PublishedVersionNo>
      <SettingsJson>String</SettingsJson>
      <Slug>String</Slug>
      <Stats>
        <NeedDecision>0</NeedDecision>
        <Overdue>0</Overdue>
        <Total>0</Total>
        <Waiting>0</Waiting>
      </Stats>
      <Status>String</Status>
      <Tone>String</Tone>
      <UpdatedAt>0001-01-01T00:00:00</UpdatedAt>
    </FormCard>
  </Forms>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
</FormListResponse>