Trendsic Platform Service

<back to all web services

FormNoticePreviewRequest

Requires Authentication
The following routes are available for this service:
POST/v1/forms/{FormUID}/notices/preview
import 'package:servicestack/servicestack.dart';

class FormInboxCount implements IConvertible
{
    String? V;
    String? L;
    int? N;

    FormInboxCount({this.V,this.L,this.N});
    FormInboxCount.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'V': V,
        'L': L,
        'N': N
    };

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

class FormNoticePreviewResponse implements IConvertible
{
    String? Subject;
    String? Body;
    String? Meta;
    String? SubmissionUID;
    bool? Sample;
    String? SampleNote;
    int? TextLength;
    int? Segments;
    bool? Wide;
    List<String>? Problems = [];
    List<FormInboxCount>? Samples = [];
    ResponseStatus? ResponseStatus;

    FormNoticePreviewResponse({this.Subject,this.Body,this.Meta,this.SubmissionUID,this.Sample,this.SampleNote,this.TextLength,this.Segments,this.Wide,this.Problems,this.Samples,this.ResponseStatus});
    FormNoticePreviewResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Subject = json['Subject'];
        Body = json['Body'];
        Meta = json['Meta'];
        SubmissionUID = json['SubmissionUID'];
        Sample = json['Sample'];
        SampleNote = json['SampleNote'];
        TextLength = json['TextLength'];
        Segments = json['Segments'];
        Wide = json['Wide'];
        Problems = JsonConverters.fromJson(json['Problems'],'List<String>',context!);
        Samples = JsonConverters.fromJson(json['Samples'],'List<FormInboxCount>',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Subject': Subject,
        'Body': Body,
        'Meta': Meta,
        'SubmissionUID': SubmissionUID,
        'Sample': Sample,
        'SampleNote': SampleNote,
        'TextLength': TextLength,
        'Segments': Segments,
        'Wide': Wide,
        'Problems': JsonConverters.toJson(Problems,'List<String>',context!),
        'Samples': JsonConverters.toJson(Samples,'List<FormInboxCount>',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

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

class FormNoticePreviewRequest implements IConvertible
{
    String? FormUID;
    String? Id;
    String? Lang;
    String? Channel;
    String? Subject;
    String? Body;
    String? Text;
    String? Closing;
    String? SubmissionUID;

    FormNoticePreviewRequest({this.FormUID,this.Id,this.Lang,this.Channel,this.Subject,this.Body,this.Text,this.Closing,this.SubmissionUID});
    FormNoticePreviewRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        FormUID = json['FormUID'];
        Id = json['Id'];
        Lang = json['Lang'];
        Channel = json['Channel'];
        Subject = json['Subject'];
        Body = json['Body'];
        Text = json['Text'];
        Closing = json['Closing'];
        SubmissionUID = json['SubmissionUID'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'FormUID': FormUID,
        'Id': Id,
        'Lang': Lang,
        'Channel': Channel,
        'Subject': Subject,
        'Body': Body,
        'Text': Text,
        'Closing': Closing,
        'SubmissionUID': SubmissionUID
    };

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

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

Dart FormNoticePreviewRequest DTOs

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

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/forms/{FormUID}/notices/preview HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"FormUID":"00000000000000000000000000000000","Id":"String","Lang":"String","Channel":"String","Subject":"String","Body":"String","Text":"String","Closing":"String","SubmissionUID":"00000000000000000000000000000000"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Subject":"String","Body":"String","Meta":"String","SubmissionUID":"String","Sample":false,"SampleNote":"String","TextLength":0,"Segments":0,"Wide":false,"Problems":["String"],"Samples":[{"V":"String","L":"String","N":0}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}