跳到主要内容

Client Mail API Reference

Mail is a service that helps developers send in-game mails with attachments to players asynchronously through the PGOS web portal or virtual server. Game client can pull mails, mark mails, delete mails and claim the attachment in mails.

API List

APIDescription
GetMailListGet mail list by category, category 'All' represents all categories.
DeleteMailByIdDelete mail by mail ID.
DeleteReadMailByCategoryDelete read mails by category.
MarkMailAsReadByIdMark mail as read by id.
MarkMailAsReadByCategoryMark mail as read by category.
ClaimMailAttachmentByIdClaim mail attachments by mail ID.
ClaimMailAttachmentByCategoryClaim mail attachments by category.
GetMailBadgeNumGet the number of unread mails.

Event List

EventDescription
OnBadgeNumOfMailThe event will be triggered when player login PGOS or the total unread count of mails changes.
OnReceiveNewMailThe event will be triggered when a new mail is received.

API Details

GetMailList

Get mail list by category, category 'All' represents all categories.

/// <summary>Get mail list by category, category 'All' represents all categories.</summary>
/// <param name="pgos_params">Request parameters for get mail list.</param>
public void GetMailList(GetMailListParams pgos_params, MailDelegate0 callback);

Parameters:

ParamTypeDescription
pgos_paramsGetMailListParamsRequest parameters for get mail list.
callbackMailDelegate0

Return: void

DeleteMailById

Delete mail by mail ID.

/// <summary>Delete mail by mail ID.</summary>
/// <param name="mail_ids">Mail IDs.</param>
public void DeleteMailById(List<string> mail_ids, MailDelegate1 callback);

Parameters:

ParamTypeDescription
mail_idsList<string>Mail IDs.
callbackMailDelegate1

Return: void

DeleteReadMailByCategory

Delete read mails by category.

/// <summary>Delete read mails by category.</summary>
/// <param name="category">Mail category, category 'All' represents all categories.</param>
public void DeleteReadMailByCategory(MailCategory category, MailDelegate1 callback);

Parameters:

ParamTypeDescription
categoryMailCategoryMail category, category 'All' represents all categories.
callbackMailDelegate1

Return: void

MarkMailAsReadById

Mark mail as read by id.

/// <summary>Mark mail as read by id.</summary>
/// <param name="mail_ids">Mail IDs.</param>
public void MarkMailAsReadById(List<string> mail_ids, MailDelegate1 callback);

Parameters:

ParamTypeDescription
mail_idsList<string>Mail IDs.
callbackMailDelegate1

Return: void

MarkMailAsReadByCategory

Mark mail as read by category.

/// <summary>Mark mail as read by category.</summary>
/// <param name="category">Mail category, category 'All' represents all categories.</param>
public void MarkMailAsReadByCategory(MailCategory category, MailDelegate1 callback);

Parameters:

ParamTypeDescription
categoryMailCategoryMail category, category 'All' represents all categories.
callbackMailDelegate1

Return: void

ClaimMailAttachmentById

Claim mail attachments by mail ID.

/// <summary>Claim mail attachments by mail ID.</summary>
/// <param name="mail_ids">Mail IDs.</param>
public void ClaimMailAttachmentById(List<string> mail_ids, MailDelegate2 callback);

Parameters:

ParamTypeDescription
mail_idsList<string>Mail IDs.
callbackMailDelegate2

Return: void

ClaimMailAttachmentByCategory

Claim mail attachments by category.

/// <summary>Claim mail attachments by category.</summary>
/// <param name="category">Mail category, category 'All' represents all categories.</param>
public void ClaimMailAttachmentByCategory(MailCategory category, MailDelegate2 callback);

Parameters:

ParamTypeDescription
categoryMailCategoryMail category, category 'All' represents all categories.
callbackMailDelegate2

Return: void

GetMailBadgeNum

Get the number of unread mails.

/// <summary>Get the number of unread mails.</summary>
public void GetMailBadgeNum(MailDelegate3 callback);

Parameters:

ParamTypeDescription
callbackMailDelegate3

Return: void

Event Details

OnBadgeNumOfMail

The event will be triggered when player login PGOS or the total unread count of mails changes.

/// <summary>The event will be triggered when player login PGOS or the total unread count of mails changes.</summary>
public event MailDelegate4 OnBadgeNumOfMail;

Type Reference:

OnReceiveNewMail

The event will be triggered when a new mail is received.

/// <summary>The event will be triggered when a new mail is received.</summary>
public event MailDelegate5 OnReceiveNewMail;

Type Reference:

All Delegates

public delegate void MailDelegate0(PgosResult a0, GetMailListResult a1);
public delegate void MailDelegate1(PgosResult a0);
public delegate void MailDelegate2(PgosResult a0, ClaimMailAttachmentResult a1);
public delegate void MailDelegate3(PgosResult a0, GetMailBadgeNumResult a1);
public delegate void MailDelegate4(BadgeNumOfMailEvt a0);
public delegate void MailDelegate5(ReceiveNewMailEvt a0);

Type Reference: