| GET,POST | /{Workspace}/Conversation | ||
|---|---|---|---|
| GET | /{Workspace}/Conversation/{ObjectId} | ||
| GET | /{Workspace}/Conversation/Search/{MemberId} | ||
| GET | /{Workspace}/Conversation/Search/{SearchType}/{SearchText} |
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ConversationEvent:
object_id: Optional[str] = None
workspace: Optional[str] = None
date: Optional[str] = None
conversation_id: Optional[str] = None
user_id: Optional[str] = None
text: Optional[str] = None
thumbnail_id: Optional[str] = None
is_link: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Conversation:
object_id: Optional[str] = None
workspace: Optional[str] = None
team_id: Optional[str] = None
members: Optional[List[str]] = None
events: Optional[List[ConversationEvent]] = None
unread: int = 0
member_id: Optional[str] = None
search_type: Optional[str] = None
search_text: Optional[str] = None
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>