본문으로 건너뛰기
버전: 5.18.6

GetPostList(PostType.Webshop)

public BackendReturnObject GetPostList(PostType.Webshop);
public BackendReturnObject GetPostList(PostType.Webshop, int limit);

파라미터

ValueTypeDescription
postTypePostType불러올 우편의 종류
limitint불러올 우편의 갯수. 최소 10개, 최대 100개. 미입력 시 limit은 10개로 지정됩니다.

limit이 10 미만일 경우, 10으로 고정됩니다.

PostType

ValueDescription
Admin콘솔에서 발송하는 관리자 우편
Rank랭킹 결산 후 자동으로 지급되는 랭킹 우편
Coupon뒤끝 콘솔의 웹 쿠폰 설정에서 생성한 페이지로 쿠폰을 사용 후 발송되는 쿠폰 우편
Webshop웹숍에서 아이템 구매 후 발송되는 우편 (뉴플레이에서는 인증 번호 발송 우편도 포함)
User유저끼리 자신의 데이터를 이용하여 발송한 유저 우편

설명

우편 종류(PostType)에 따른 우편 리스트를 불러옵니다.

각 PostType의 종류마다 리턴값에 추가된 값이 존재하거나 없을 수 있으므로 아래 GetReturnValuetoJSON()을 참고해주시기 바랍니다.

유저 우편의 경우, 관리자 우편과 랭킹 우편과는 Json 타입이 크게 다를 수 있으므로 주의해주시기 바랍니다.

  • 리턴값에 기존 우편 기능(Backend.Social.Post) 리턴값에 존재했던 데이터 타입 "S", "L", "M"이 존재하지 않습니다.
  • 각 우편은 우편 종류별로 만료일이 존재하며, 만료일이 지난 우편은 리스트에서 삭제됩니다.
  • 우편 불러오기를 통해 해당 우편을 불러온 유저는 콘솔-우편 관리의 세부 정보에서 '미수령'으로 표시되며, 수령 시 수령한 날짜가 표시됩니다.
  • 웹숍 우편의 경우 아이템 수령 시 아이템이 자동으로 삭제됩니다.
  • 웹숍 우편의 만료일은 30일로 고정되어 있습니다.

Example

5.18.6 이전 SDK 버전 안내

5.18.6 이전 버전 SDK에서는 웹숍 우편 처리를 하기 위해서는 아래의 함수를 이용하여 우편 처리를 해야 합니다.

// 우편 타입을 5로 지정해야 웹숍 우편을 불러올 수 있습니다.
var bro = Backend.NewFunctions.Mail.GetMailList((MailType)5);

동기

BackendReturnObject bro = Backend.UPost.GetPostList(PostType.Webshop, 10);
LitJson.JsonData json = bro.GetReturnValuetoJSON()["postList"];

for(int i = 0; i < json.Count; i++) {
Debug.Log("제목 : " + json[i]["title"].ToString());
Debug.Log("inDate : " + json[i]["inDate"].ToString());
}

비동기

Backend.UPost.GetPostList(PostType.Webshop, 10, callback => {
LitJson.JsonData json = callback.GetReturnValuetoJSON()["postList"];

for(int i = 0; i < json.Count; i++) {
Debug.Log("제목 : " + json[i]["title"].ToString());
Debug.Log("inDate : " + json[i]["inDate"].ToString());
}
});

SendQueue

SendQueue.Enqueue(Backend.UPost.GetPostList, PostType.Webshop, 10, callback =>  {
LitJson.JsonData json = callback.GetReturnValuetoJSON()["postList"];

for(int i = 0; i < json.Count; i++) {
Debug.Log("제목 : " + json[i]["title"].ToString());
Debug.Log("inDate : " + json[i]["inDate"].ToString());
}
});

ReturnCase

Success cases

우편 불러오기에 성공한 경우
statusCode : 200
message : Success
returnValue : GetReturnValuetoJSON 참조

불러올 우편이 없을 경우
statusCode : 200
message : Success
returnValue : { "postList" : []}

GetReturnValuetoJSON

웹숍 우편

{
"postList": [
{
"inDate": "2026-01-27T06:57:16.078Z", // 우편의 inDate
"title": "상품 1 구매 완료", // 우편의 제목
"content": "아이템을 구매해주셔서 감사합니다.", // 우편의 내용
"expirationDate": "2026-02-26T06:57:16.078Z", // 만료 날짜
"webshop": "newplay", // 우편이 발송된 웹숍 서비스 이름
"buyer": "1769129189338", // 우편의 구매자
"author": "NEWPLAY", // 우편의 발송인
"orderId": "MjAyNjAxMjcwNDQ4NTUzNTgxMQ==", // 우편의 주문 번호
"itemId": "아이템1", // 우편의 아이템 ID
"item": { // 우편에 첨부된 아이템 정보
"senderUid": "1769129189338", // 우편 발송자 UID
"quantity": 3, // 우편에 첨부된 아이템 수량
"orderId": "MjAyNjAxMjcwNDQ4NTUzNTgxMQ==", // 우편의 주문 번호
"price": 1000, // 우편에 첨부된 아이템 가격
"currency": "KRW", // 우편에 첨부된 아이템 화폐 단위
"clientItemId": "100001", // 우편에 첨부된 아이템 클라이언트 아이템 ID
"receiverUid": "1769123876258" // 우편 수신자 UID
}
}
]
}

뉴플레이 인증 번호 발송 우편

{
"postList": [
{
"inDate": "2024-06-10T12:34:56.789Z", // 우편의 inDate
"title": "인증 번호 발송", // 우편의 제목
"content": "L33MXO", // 우편의 내용
"expirationDate": "2024-07-10T12:34:56.789Z", // 만료 날짜
"webshop": "newplay", // 우편이 발송된 웹숍 서비스 이름
"author": "NEWPLAY", // 우편의 발송인
}
]
}

Sample Code

웹숍 우편은 다른 우편과 JSON 구조가 다릅니다. items 배열 대신 item 단일 객체로 구매 정보가 전달됩니다.

// 웹숍 구매 아이템 정보
public class WebshopItem {
public string senderUid;
public int quantity;
public string orderId;
public int price;
public string currency;
public string clientItemId;
public string receiverUid;

public override string ToString() {
return
"item : \n" +
$"| senderUid : {senderUid}\n" +
$"| quantity : {quantity}\n" +
$"| orderId : {orderId}\n" +
$"| price : {price}\n" +
$"| currency : {currency}\n" +
$"| clientItemId : {clientItemId}\n" +
$"| receiverUid : {receiverUid}\n";
}
}

public enum WebshopPostType {
NewplayVerificationCode, // 뉴플레이 인증 번호 발송 우편
ItemPurchase // 아이템 구매 우편
}

// 웹숍 우편 정보
public class WebshopPostItem {
public WebshopPostType postType;
public string inDate;
public string title;
public string content;
public DateTime expirationDate;
public string webshop;
public string buyer;
public string author;
public string orderId;
public string itemId;
public WebshopItem item;

public override string ToString() {
return
$"title : {title}\n" +
$"inDate : {inDate}\n" +
$"content : {content}\n" +
$"expirationDate : {expirationDate}\n" +
$"webshop : {webshop}\n" +
$"buyer : {buyer}\n" +
$"author : {author}\n" +
$"orderId : {orderId}\n" +
$"itemId : {itemId}\n" +
(item != null ? item.ToString() : "item : null\n");
}
}
public void GetWebshopPostListTest() {
int limit = 100;

BackendReturnObject bro = Backend.UPost.GetPostList(PostType.Webshop, limit);
if(!bro.IsSuccess()) {
Debug.LogError(bro.ToString());
return;
}

LitJson.JsonData postListJson = bro.GetReturnValuetoJSON()["postList"];

List<WebshopPostItem> postItemList = new List<WebshopPostItem>();

for(int i = 0; i < postListJson.Count; i++) {
WebshopPostItem postItem = new WebshopPostItem();

postItem.inDate = postListJson[i]["inDate"].ToString();
postItem.title = postListJson[i]["title"].ToString();
postItem.content = postListJson[i]["content"].ToString();
postItem.expirationDate = DateTime.Parse(postListJson[i]["expirationDate"].ToString());
postItem.webshop = postListJson[i]["webshop"].ToString();
postItem.author = postListJson[i]["author"].ToString();

// 웹숍 우편의 item은 단일 객체
if(postListJson[i].ContainsKey("item") && postListJson[i]["item"] != null) {
postItem.postType = WebshopPostType.ItemPurchase;

postItem.buyer = postListJson[i]["buyer"].ToString();
postItem.orderId = postListJson[i]["orderId"].ToString();
postItem.itemId = postListJson[i]["itemId"].ToString();

WebshopItem item = new WebshopItem();

item.senderUid = postListJson[i]["item"]["senderUid"].ToString();
item.quantity = int.Parse(postListJson[i]["item"]["quantity"].ToString());
item.orderId = postListJson[i]["item"]["orderId"].ToString();
item.price = int.Parse(postListJson[i]["item"]["price"].ToString());
item.currency = postListJson[i]["item"]["currency"].ToString();
item.clientItemId = postListJson[i]["item"]["clientItemId"].ToString();
item.receiverUid = postListJson[i]["item"]["receiverUid"].ToString();

postItem.item = item;
} else {
// 뉴플레이 인증 번호 발송 우편의 경우 item이 없음
postItem.postType = WebshopPostType.NewplayVerificationCode;
}

postItemList.Add(postItem);
Debug.Log(postItem.ToString());
}
}