paraworld.friends.add

Description

发送好友邀请或接受别人的好友邀请。

返回值中的state节点说明了操作结果的状态:1:双方已成为好友。 2:已向对方发送了好友请求。 3:对方已是您的好友,不必重复请求

Parameters

Required Name TypeSorted ascending Description
optional relationType int 关系类型。当前只有一种关系类型:0(好友)。默认值为0
optional format int 要求返回数据的格式(0:XML 1:JSON),默认值为0
required sessionKey string 用户凭证。
required friendUserID string 接受信息者的用户ID

Example Return XML

<msg xmlns="">
        <isSuccess type="boolean">True</isSuccess>
        <state type="double">2</state>
</msg>

Example Return JSON

{"isSuccess":"true","state":"2"}

Error Codes

当发生异常时,返回数据中会有一个“errorCode”节点,该节点记录了错误码。0:无异常 500:未知错误 499:提供的数据不完整 498:非法的访问 497:数据不存在或已被删除 496:未登录

Test Cases

case 1

Input:

{

        ["relationType"]=0,

        ["friendUserID"]="0a3b1121-b72f-4100-9943-bf0bacf7d045",

        ["sessionKey"]="f770dcfe-cd18-4e05-9d2f-6eb1f1859864",

}

Result:

{

        ["isSuccess"]=true,

        ["state"]=2,

}

case 2

Input:

{

        ["relationType"]=0,

        ["friendUserID"]="6ea770c6-92b2-4b2b-86da-6f574641ec11",

        ["sessionKey"]="d51d47c3-56e7-43b0-89d3-3321545a6896",

}

Result:

{

        ["isSuccess"]=true,

        ["state"]=1,

}

case 3

Input:

{

        ["relationType"]=0,

        ["friendUserID"]="0a3b1121-b72f-4100-9943-bf0bacf7d045",

        ["sessionKey"]="f770dcfe-cd18-4e05-9d2f-6eb1f1859864",

}

Result:

{

        ["isSuccess"]=false,

        ["state"]=3,

}
Topic revision: r2 - 2008-12-06 - CaoYF
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback