| Required role: | Admin |
| POST | /SurveyCampaign/{CampaignId}/Recipients |
|---|
import 'package:servicestack/servicestack.dart';
class SurveyRecipientImportResult implements IConvertible
{
int? inserted;
int? skipped;
int? invalid;
List<String>? invalidRows;
int? statusCode;
String? message;
SurveyRecipientImportResult({this.inserted,this.skipped,this.invalid,this.invalidRows,this.statusCode,this.message});
SurveyRecipientImportResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
inserted = json['inserted'];
skipped = json['skipped'];
invalid = json['invalid'];
invalidRows = JsonConverters.fromJson(json['invalidRows'],'List<String>',context!);
statusCode = json['statusCode'];
message = json['message'];
return this;
}
Map<String, dynamic> toJson() => {
'inserted': inserted,
'skipped': skipped,
'invalid': invalid,
'invalidRows': JsonConverters.toJson(invalidRows,'List<String>',context!),
'statusCode': statusCode,
'message': message
};
getTypeName() => "SurveyRecipientImportResult";
TypeContext? context = _ctx;
}
class SurveyRecipientImportRow implements IConvertible
{
String? email;
String? segment;
String? surveyUrl;
SurveyRecipientImportRow({this.email,this.segment,this.surveyUrl});
SurveyRecipientImportRow.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
email = json['email'];
segment = json['segment'];
surveyUrl = json['surveyUrl'];
return this;
}
Map<String, dynamic> toJson() => {
'email': email,
'segment': segment,
'surveyUrl': surveyUrl
};
getTypeName() => "SurveyRecipientImportRow";
TypeContext? context = _ctx;
}
class SurveyRecipientImportRequest implements IConvertible
{
int? campaignId;
List<SurveyRecipientImportRow>? rows;
SurveyRecipientImportRequest({this.campaignId,this.rows});
SurveyRecipientImportRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
campaignId = json['campaignId'];
rows = JsonConverters.fromJson(json['rows'],'List<SurveyRecipientImportRow>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'campaignId': campaignId,
'rows': JsonConverters.toJson(rows,'List<SurveyRecipientImportRow>',context!)
};
getTypeName() => "SurveyRecipientImportRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
'SurveyRecipientImportResult': TypeInfo(TypeOf.Class, create:() => SurveyRecipientImportResult()),
'SurveyRecipientImportRow': TypeInfo(TypeOf.Class, create:() => SurveyRecipientImportRow()),
'SurveyRecipientImportRequest': TypeInfo(TypeOf.Class, create:() => SurveyRecipientImportRequest()),
'List<SurveyRecipientImportRow>': TypeInfo(TypeOf.Class, create:() => <SurveyRecipientImportRow>[]),
});
Dart SurveyRecipientImportRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /SurveyCampaign/{CampaignId}/Recipients HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
campaignId: 0,
rows:
[
{
email: String,
segment: String,
surveyUrl: String
}
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
inserted: 0,
skipped: 0,
invalid: 0,
invalidRows:
[
String
],
statusCode: 0,
message: String
}