| 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 .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<SurveyRecipientImportRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<CampaignId>0</CampaignId>
<Rows>
<SurveyRecipientImportRow>
<Email>String</Email>
<Segment>String</Segment>
<SurveyUrl>String</SurveyUrl>
</SurveyRecipientImportRow>
</Rows>
</SurveyRecipientImportRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<SurveyRecipientImportResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<Inserted>0</Inserted>
<Invalid>0</Invalid>
<InvalidRows xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</InvalidRows>
<Message>String</Message>
<Skipped>0</Skipped>
<StatusCode>0</StatusCode>
</SurveyRecipientImportResult>