zoukankan      html  css  js  c++  java
  • eBay 消息发送(1)

     

    1.简介

    Call Index Doc:

    http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/index.html

     

    消息发送主要分为三类:

    AddMemberMessageRTQ

    允许卖家回复关于在线item的问题。

    AddMemberMessageAAQToPartner

    见 eBay消息发送(2)

    AddMemberMessagesAAQToBidder

    见 eBay消息发送(3)

     

    2.AddMemberMessageRTQ

    以MemberMessageType作为载体发送。

    2.1输入字段

     

    ItemID

    提问所应对的Item唯一ID。

     

    MemberMessage内容

    Body

    消息的主体,不支持原生的HTML,编码后的HTML也不会自动解码。最大长度为2000。

    DisplayToPublic

    表明这条消息是否在item listing中可见。

    ParentMessageID

    需要回复的消息ID。

    RecipientID

    收件人,填入eBay用户ID。

    SendID

    发件人ID

     

    2.2输出

     

     

    ApiResponse内容

    Ack

    CustomCode

    (out) Reserved for internal or future use.

    Failure

    (out) Request processing failed

    Success

    (out) Request processing succeeded

    Warning

    (out) Request processing completed with warning information being included in the response message

    Errors

     

    2.3沙箱测试

    You can test this call in the Sandbox. To test AddMemberMessageRTQ, you must have at least two test users in the Sandbox environment.

    1. List an item in the Sandbox using AddItem.
    2. Have a different user send the seller a question about the item. You can use the Sandbox UI for this step.
    3. Using the seller as the authenticated user, call GetMemberMessages (this will be the user for AddMemberMessageRTQ).
    4. In the call to AddMemberMessageRTQ, set ParentMessageID to the value ofMemberMessage.MemberMessageExchange.Question.MessageID that was returned from the GetMemberMessages call.
    5. Set RecipientID to the user ID of the original sender.
    6. Type the response to the question in the Body field.

     

    3.样例代码

     

    1. public void SendMessagesRTQ(ApiContext context, string subject, string body, string recipientID, string parentMessageID, string senderID, string itemID)
    2. {
    3.     try
    4.     {
    5.         //回复客人消息
    6.         var addCall = new AddMemberMessageRTQCall(context);
    7.         var memberMessageType = new MemberMessageType()
    8.         {
    9.             Body = body,
    10.             ParentMessageID = parentMessageID,
    11.             RecipientID = new StringCollection { recipientID },
    12.             SenderID = senderID,
    13.             DisplayToPublic = false,
    14.             DisplayToPublicSpecified = true
    15.         };
    16.  
    17.         //用于回复买家Message的Call,不过只能用于回复买家关于在线商品的提问
    18.         addCall.AddMemberMessageRTQ(itemID, memberMessageType);
    19.     }
    20.     catch (Exception ex)
    21.     {
    22.         throw new EbayAPIExpcetion(ex.Message, ex.InnerException == null ? ex : ex.InnerException);
    23.     }
    24. }
  • 相关阅读:
    [北大机试C]:走迷宫(BFS)
    [北大机试B][OpenJ_Bailian-2965]:玛雅历(模拟)
    [北大机试A]:有趣的跳跃(模拟)
    [2019北大机试D]:最大上升子序列和(DP)[计蒜客-T1221/HDU1087]
    [牛客练习赛53] A.超越学姐爱字符串 [dp]
    [牛客][北大考研复试]I Wanna Go Home[dijkstra]
    SP1716 GSS3
    牛客小白月赛13_A_小A的签到题
    自习室管理系统,基于B/S模式下的JAVA系统
    基于SSH的聊天室
  • 原文地址:https://www.cnblogs.com/pengzhen/p/4536362.html
Copyright © 2011-2022 走看看