Required role: | REGISUserRole |
POST | /DynamicsCRM/Activity/Create/Multiple |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class CRMActivityCreateRequest implements IConvertible
{
int? regent_id;
String? lead_guid;
int? import_id;
String? subject;
String? description;
String? phone_email;
List<String>? email_cc;
String? gmail_thread_index;
String? related_username;
DateTime? scheduled_start;
DateTime? scheduled_end;
String? event_location;
String? event_type;
String? event_participation;
bool? is_completed;
bool? is_contact;
bool? is_lead;
bool? is_account;
bool? is_email;
bool? is_letter;
bool? is_phonecall;
bool? is_task;
bool? is_meeting;
bool? is_event;
DateTime? date_of_occurrence;
DateTime? added_date;
CRMActivityCreateRequest({this.regent_id,this.lead_guid,this.import_id,this.subject,this.description,this.phone_email,this.email_cc,this.gmail_thread_index,this.related_username,this.scheduled_start,this.scheduled_end,this.event_location,this.event_type,this.event_participation,this.is_completed,this.is_contact,this.is_lead,this.is_account,this.is_email,this.is_letter,this.is_phonecall,this.is_task,this.is_meeting,this.is_event,this.date_of_occurrence,this.added_date});
CRMActivityCreateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
regent_id = json['regent_id'];
lead_guid = json['lead_guid'];
import_id = json['import_id'];
subject = json['subject'];
description = json['description'];
phone_email = json['phone_email'];
email_cc = JsonConverters.fromJson(json['email_cc'],'List<String>',context!);
gmail_thread_index = json['gmail_thread_index'];
related_username = json['related_username'];
scheduled_start = JsonConverters.fromJson(json['scheduled_start'],'DateTime',context!);
scheduled_end = JsonConverters.fromJson(json['scheduled_end'],'DateTime',context!);
event_location = json['event_location'];
event_type = json['event_type'];
event_participation = json['event_participation'];
is_completed = json['is_completed'];
is_contact = json['is_contact'];
is_lead = json['is_lead'];
is_account = json['is_account'];
is_email = json['is_email'];
is_letter = json['is_letter'];
is_phonecall = json['is_phonecall'];
is_task = json['is_task'];
is_meeting = json['is_meeting'];
is_event = json['is_event'];
date_of_occurrence = JsonConverters.fromJson(json['date_of_occurrence'],'DateTime',context!);
added_date = JsonConverters.fromJson(json['added_date'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'regent_id': regent_id,
'lead_guid': lead_guid,
'import_id': import_id,
'subject': subject,
'description': description,
'phone_email': phone_email,
'email_cc': JsonConverters.toJson(email_cc,'List<String>',context!),
'gmail_thread_index': gmail_thread_index,
'related_username': related_username,
'scheduled_start': JsonConverters.toJson(scheduled_start,'DateTime',context!),
'scheduled_end': JsonConverters.toJson(scheduled_end,'DateTime',context!),
'event_location': event_location,
'event_type': event_type,
'event_participation': event_participation,
'is_completed': is_completed,
'is_contact': is_contact,
'is_lead': is_lead,
'is_account': is_account,
'is_email': is_email,
'is_letter': is_letter,
'is_phonecall': is_phonecall,
'is_task': is_task,
'is_meeting': is_meeting,
'is_event': is_event,
'date_of_occurrence': JsonConverters.toJson(date_of_occurrence,'DateTime',context!),
'added_date': JsonConverters.toJson(added_date,'DateTime',context!)
};
getTypeName() => "CRMActivityCreateRequest";
TypeContext? context = _ctx;
}
class CRMActivityCreateMultipleRequest implements IConvertible
{
bool? is_contact;
bool? is_account;
bool? is_event;
bool? is_email;
bool? is_meeting;
bool? is_phonecall;
bool? is_letter;
bool? is_task;
String? related_username;
List<CRMActivityCreateRequest>? activities;
CRMActivityCreateMultipleRequest({this.is_contact,this.is_account,this.is_event,this.is_email,this.is_meeting,this.is_phonecall,this.is_letter,this.is_task,this.related_username,this.activities});
CRMActivityCreateMultipleRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
is_contact = json['is_contact'];
is_account = json['is_account'];
is_event = json['is_event'];
is_email = json['is_email'];
is_meeting = json['is_meeting'];
is_phonecall = json['is_phonecall'];
is_letter = json['is_letter'];
is_task = json['is_task'];
related_username = json['related_username'];
activities = JsonConverters.fromJson(json['activities'],'List<CRMActivityCreateRequest>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'is_contact': is_contact,
'is_account': is_account,
'is_event': is_event,
'is_email': is_email,
'is_meeting': is_meeting,
'is_phonecall': is_phonecall,
'is_letter': is_letter,
'is_task': is_task,
'related_username': related_username,
'activities': JsonConverters.toJson(activities,'List<CRMActivityCreateRequest>',context!)
};
getTypeName() => "CRMActivityCreateMultipleRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'data.regent_college.edu', types: <String, TypeInfo> {
'CRMActivityCreateRequest': TypeInfo(TypeOf.Class, create:() => CRMActivityCreateRequest()),
'CRMActivityCreateMultipleRequest': TypeInfo(TypeOf.Class, create:() => CRMActivityCreateMultipleRequest()),
'List<CRMActivityCreateRequest>': TypeInfo(TypeOf.Class, create:() => <CRMActivityCreateRequest>[]),
});
Dart CRMActivityCreateMultipleRequest 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 /DynamicsCRM/Activity/Create/Multiple HTTP/1.1
Host: data.regent-college.edu
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"is_contact":false,"is_account":false,"is_event":false,"is_email":false,"is_meeting":false,"is_phonecall":false,"is_letter":false,"is_task":false,"related_username":"String","activities":[{"regent_id":0,"lead_guid":"String","import_id":0,"subject":"String","description":"String","phone_email":"String","email_cc":["String"],"gmail_thread_index":"String","related_username":"String","scheduled_start":"0001-01-01T00:00:00.0000000","scheduled_end":"0001-01-01T00:00:00.0000000","event_location":"String","event_type":"String","event_participation":"String","is_completed":false,"is_contact":false,"is_lead":false,"is_account":false,"is_email":false,"is_letter":false,"is_phonecall":false,"is_task":false,"is_meeting":false,"is_event":false,"date_of_occurrence":"0001-01-01T00:00:00.0000000","added_date":"0001-01-01T00:00:00.0000000"}]}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}