Thread Email client thread operations.
An email thread is a conversation that starts from the original email and includes
all of the replies to it.
Email client provides functions to:
Get a list of all email threads in the given folder.
Fetch all messages from the given thread.
Delete an entire thread or move it to another folder.
Mark all messages in the given thread as read or unread.
Email threads are supported even if the email server does not support such function.
Just add a cache file location to the account configuration if you need to support
emulated email threads.
Delete
Delete thread by id. All messages from thread will also be deleted. Requires:
request
Delete email thread request. Type: ClientThreadDeleteRequest .
C#
var request = new ClientThreadDeleteRequest
{
Folder = "INBOX/SubFolder" ,
ThreadId = "5" ,
AccountLocation = new StorageFileLocation
{
FileName = "email.account" ,
Storage = "First Storage" ,
FolderPath = "file/location/folder/on/storage"
}
};
Java
ClientThreadDeleteRequest request = Models . clientThreadDeleteRequest ()
. folder ( "INBOX/SubFolder" )
. threadId ( "5" )
. accountLocation ( Models . storageFileLocation ()
. fileName ( "email.account" )
. storage ( "First Storage" )
. folderPath ( "file/location/folder/on/storage" )
. build ())
. build ();
Python
request = models . ClientThreadDeleteRequest (
folder = 'INBOX/SubFolder' ,
thread_id = '5' ,
account_location = models . StorageFileLocation (
file_name = 'email.account' ,
storage = 'First Storage' ,
folder_path = 'file/location/folder/on/storage' ))
Ruby
request = ClientThreadDeleteRequest . new (
folder : 'INBOX/SubFolder' ,
thread_id : '5' ,
account_location : StorageFileLocation . new (
file_name : 'email.account' ,
storage : 'First Storage' ,
folder_path : 'file/location/folder/on/storage' ))
Typescript
let request = Models . clientThreadDeleteRequest ()
. folder ( 'INBOX/SubFolder' )
. threadId ( '5' )
. accountLocation ( Models . storageFileLocation ()
. fileName ( 'email.account' )
. storage ( 'First Storage' )
. folderPath ( 'file/location/folder/on/storage' )
. build ())
. build ();
PHP
$request = Models :: clientThreadDeleteRequest ()
-> folder ( 'INBOX/SubFolder' )
-> threadId ( '5' )
-> accountLocation ( Models :: storageFileLocation ()
-> fileName ( 'email.account' )
-> storage ( 'First Storage' )
-> folderPath ( 'file/location/folder/on/storage' )
-> build ())
-> build ();
GetList
Get message threads from folder. All messages are partly fetched (without email body and some other fields).
Returns EmailThreadList model. Requires:
request
GetList method request. Type: ClientThreadGetListRequest .
GetMessages
Get messages from thread by id. All messages are fully fetched. For accounts with CacheFile only cached messages will be returned.
Returns EmailList model. Requires:
request
GetMessages method request. Type: ClientThreadGetMessagesRequest .
C#
var request = new ClientThreadGetMessagesRequest
{
ThreadId = "5" ,
Account = "email.account" ,
Folder = "INBOX" ,
Storage = "First Storage" ,
AccountStorageFolder = "email/account/location/on/storage"
};
Java
ClientThreadGetMessagesRequest request = Models . clientThreadGetMessagesRequest ()
. threadId ( "5" )
. account ( "email.account" )
. folder ( "INBOX" )
. storage ( "First Storage" )
. accountStorageFolder ( "email/account/location/on/storage" )
. build ();
Python
request = models . ClientThreadGetMessagesRequest (
thread_id = '5' ,
account = 'email.account' ,
folder = 'INBOX' ,
storage = 'First Storage' ,
account_storage_folder = 'email/account/location/on/storage' )
Ruby
request = ClientThreadGetMessagesRequest . new (
thread_id : '5' ,
account : 'email.account' ,
folder : 'INBOX' ,
storage : 'First Storage' ,
account_storage_folder : 'email/account/location/on/storage' )
Typescript
let request = Models . ClientThreadGetMessagesRequest ()
. threadId ( '5' )
. account ( 'email.account' )
. folder ( 'INBOX' )
. storage ( 'First Storage' )
. accountStorageFolder ( 'email/account/location/on/storage' )
. build ();
PHP
$request = Models :: ClientThreadGetMessagesRequest ()
-> thread_id ( '5' )
-> account ( 'email.account' )
-> folder ( 'INBOX' )
-> storage ( 'First Storage' )
-> account_storage_folder ( 'email/account/location/on/storage' )
-> build ();
Move
Move thread to another folder. Requires:
request
Move thread request. Type: ClientThreadMoveRequest .
C#
var request = new ClientThreadMoveRequest
{
DestinationFolder = "INBOX/SubFolder" ,
SourceFolder = "INBOX" ,
ThreadId = "5" ,
AccountLocation = new StorageFileLocation
{
FileName = "email.account" ,
Storage = "First Storage" ,
FolderPath = "file/location/folder/on/storage"
}
};
Java
ClientThreadMoveRequest request = Models . clientThreadMoveRequest ()
. destinationFolder ( "INBOX/SubFolder" )
. sourceFolder ( "INBOX" )
. threadId ( "5" )
. accountLocation ( Models . storageFileLocation ()
. fileName ( "email.account" )
. storage ( "First Storage" )
. folderPath ( "file/location/folder/on/storage" )
. build ())
. build ();
Python
request = models . ClientThreadMoveRequest (
destination_folder = 'INBOX/SubFolder' ,
source_folder = 'INBOX' ,
thread_id = '5' ,
account_location = models . StorageFileLocation (
file_name = 'email.account' ,
storage = 'First Storage' ,
folder_path = 'file/location/folder/on/storage' ))
Ruby
request = ClientThreadMoveRequest . new (
destination_folder : 'INBOX/SubFolder' ,
source_folder : 'INBOX' ,
thread_id : '5' ,
account_location : StorageFileLocation . new (
file_name : 'email.account' ,
storage : 'First Storage' ,
folder_path : 'file/location/folder/on/storage' ))
Typescript
let request = Models . clientThreadMoveRequest ()
. destinationFolder ( 'INBOX/SubFolder' )
. sourceFolder ( 'INBOX' )
. threadId ( '5' )
. accountLocation ( Models . storageFileLocation ()
. fileName ( 'email.account' )
. storage ( 'First Storage' )
. folderPath ( 'file/location/folder/on/storage' )
. build ())
. build ();
PHP
$request = Models :: clientThreadMoveRequest ()
-> destinationFolder ( 'INBOX/SubFolder' )
-> sourceFolder ( 'INBOX' )
-> threadId ( '5' )
-> accountLocation ( Models :: storageFileLocation ()
-> fileName ( 'email.account' )
-> storage ( 'First Storage' )
-> folderPath ( 'file/location/folder/on/storage' )
-> build ())
-> build ();
SetIsRead
Mark all messages in thread as read or unread. Requires:
request
Email account specifier and IsRead flag. Type: ClientThreadSetIsReadRequest .
C#
var request = new ClientThreadSetIsReadRequest
{
IsRead = true ,
Folder = "INBOX" ,
ThreadId = "5" ,
AccountLocation = new StorageFileLocation
{
FileName = "email.account" ,
Storage = "First Storage" ,
FolderPath = "file/location/folder/on/storage"
}
};
Java
ClientThreadSetIsReadRequest request = Models . clientThreadSetIsReadRequest ()
. isRead ( true )
. folder ( "INBOX" )
. threadId ( "5" )
. accountLocation ( Models . storageFileLocation ()
. fileName ( "email.account" )
. storage ( "First Storage" )
. folderPath ( "file/location/folder/on/storage" )
. build ())
. build ();
Python
request = models . ClientThreadSetIsReadRequest (
is_read = True ,
folder = 'INBOX' ,
thread_id = '5' ,
account_location = models . StorageFileLocation (
file_name = 'email.account' ,
storage = 'First Storage' ,
folder_path = 'file/location/folder/on/storage' ))
Ruby
request = ClientThreadSetIsReadRequest . new (
is_read : true ,
folder : 'INBOX' ,
thread_id : '5' ,
account_location : StorageFileLocation . new (
file_name : 'email.account' ,
storage : 'First Storage' ,
folder_path : 'file/location/folder/on/storage' ))
Typescript
let request = Models . clientThreadSetIsReadRequest ()
. isRead ( true )
. folder ( 'INBOX' )
. threadId ( '5' )
. accountLocation ( Models . storageFileLocation ()
. fileName ( 'email.account' )
. storage ( 'First Storage' )
. folderPath ( 'file/location/folder/on/storage' )
. build ())
. build ();
PHP
$request = Models :: clientThreadSetIsReadRequest ()
-> isRead ( true )
-> folder ( 'INBOX' )
-> threadId ( '5' )
-> accountLocation ( Models :: storageFileLocation ()
-> fileName ( 'email.account' )
-> storage ( 'First Storage' )
-> folderPath ( 'file/location/folder/on/storage' )
-> build ())
-> build ();
More APIs