| GET,POST | /{Workspace}/Conversation | ||
|---|---|---|---|
| GET | /{Workspace}/Conversation/{ObjectId} | ||
| GET | /{Workspace}/Conversation/Search/{MemberId} | ||
| GET | /{Workspace}/Conversation/Search/{SearchType}/{SearchText} |
import 'package:servicestack/servicestack.dart';
class ConversationEvent implements IConvertible
{
String? ObjectId;
String? Workspace;
String? Date;
String? ConversationId;
String? UserId;
String? Text;
String? ThumbnailId;
bool? IsLink;
ConversationEvent({this.ObjectId,this.Workspace,this.Date,this.ConversationId,this.UserId,this.Text,this.ThumbnailId,this.IsLink});
ConversationEvent.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ObjectId = json['ObjectId'];
Workspace = json['Workspace'];
Date = json['Date'];
ConversationId = json['ConversationId'];
UserId = json['UserId'];
Text = json['Text'];
ThumbnailId = json['ThumbnailId'];
IsLink = json['IsLink'];
return this;
}
Map<String, dynamic> toJson() => {
'ObjectId': ObjectId,
'Workspace': Workspace,
'Date': Date,
'ConversationId': ConversationId,
'UserId': UserId,
'Text': Text,
'ThumbnailId': ThumbnailId,
'IsLink': IsLink
};
getTypeName() => "ConversationEvent";
TypeContext? context = _ctx;
}
class Conversation implements IConvertible
{
String? ObjectId;
String? Workspace;
String? TeamId;
List<String>? Members;
List<ConversationEvent>? Events;
int? Unread;
String? MemberId;
String? SearchType;
String? SearchText;
Conversation({this.ObjectId,this.Workspace,this.TeamId,this.Members,this.Events,this.Unread,this.MemberId,this.SearchType,this.SearchText});
Conversation.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ObjectId = json['ObjectId'];
Workspace = json['Workspace'];
TeamId = json['TeamId'];
Members = JsonConverters.fromJson(json['Members'],'List<String>',context!);
Events = JsonConverters.fromJson(json['Events'],'List<ConversationEvent>',context!);
Unread = json['Unread'];
MemberId = json['MemberId'];
SearchType = json['SearchType'];
SearchText = json['SearchText'];
return this;
}
Map<String, dynamic> toJson() => {
'ObjectId': ObjectId,
'Workspace': Workspace,
'TeamId': TeamId,
'Members': JsonConverters.toJson(Members,'List<String>',context!),
'Events': JsonConverters.toJson(Events,'List<ConversationEvent>',context!),
'Unread': Unread,
'MemberId': MemberId,
'SearchType': SearchType,
'SearchText': SearchText
};
getTypeName() => "Conversation";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
'ConversationEvent': TypeInfo(TypeOf.Class, create:() => ConversationEvent()),
'Conversation': TypeInfo(TypeOf.Class, create:() => Conversation()),
'List<ConversationEvent>': TypeInfo(TypeOf.Class, create:() => <ConversationEvent>[]),
});
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 /{Workspace}/Conversation HTTP/1.1
Host: dev.fieldsquared.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<Conversation xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Messaging">
<Events>
<ConversationEvent>
<ConversationId>String</ConversationId>
<Date>String</Date>
<IsLink>false</IsLink>
<ObjectId>String</ObjectId>
<Text>String</Text>
<ThumbnailId>String</ThumbnailId>
<UserId>String</UserId>
<Workspace>String</Workspace>
</ConversationEvent>
</Events>
<MemberId>String</MemberId>
<Members xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Members>
<ObjectId>String</ObjectId>
<SearchText>String</SearchText>
<SearchType>String</SearchType>
<TeamId>String</TeamId>
<Unread>0</Unread>
<Workspace>String</Workspace>
</Conversation>