| Requires any of the roles: | Worker, Agent, Administrator |
| POST,OPTIONS | /v1/campaigns/{Id}/{Action} |
|---|
import 'package:servicestack/servicestack.dart';
class CampaignJsonResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
CampaignJsonResponse({this.ResponseStatus});
CampaignJsonResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
};
getTypeName() => "CampaignJsonResponse";
TypeContext? context = _ctx;
}
class CampaignActionRequest implements IConvertible
{
int? Id;
String? Action;
Uint8List? RequestStream;
CampaignActionRequest({this.Id,this.Action,this.RequestStream});
CampaignActionRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Action = json['Action'];
RequestStream = JsonConverters.fromJson(json['RequestStream'],'Uint8List',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Action': Action,
'RequestStream': JsonConverters.toJson(RequestStream,'Uint8List',context!)
};
getTypeName() => "CampaignActionRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'CampaignJsonResponse': TypeInfo(TypeOf.Class, create:() => CampaignJsonResponse()),
'CampaignActionRequest': TypeInfo(TypeOf.Class, create:() => CampaignActionRequest()),
'Uint8List': TypeInfo(TypeOf.Class, create:() => Uint8List(0)),
});
Dart CampaignActionRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/campaigns/{Id}/{Action} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"Id":0,"Action":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}