http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/rpc-protocol
2.6 Creating a friend relationship to another user.
This example maps to PUTing an opensocial.Person object /people/@me/
@friends with the RESTful API. This example is a use-case not covered
by the OpenSocial JS API and is given here to show how additional
operations that a container may want to support can be defined within
this framework. This effect of this call may be different based on how
the container models the social graph. This may be interpreted as send
an invite to the specified person to create a bi-drection friend
relationship which may be accepted or rejected later. Depending on the
semantics of the group the result of the call can vary and the person
added may not be immediately visible in a subsequent person.get call
on the same group.
Notes:
The return value on success is VOID, represented by an empty JSON
structure.
userId & groupId could be omitted as they match the operation default.
Shown for completeness
URL addressable equivalent is
http://api.example.org/rpc?method=people.create&id=createFriend&userId=@me&groupId=@friends&person.id=example.org:FF256337
POST /rpc HTTP/1.1
Host:
api.example.org
Authorization: <auth token>
Content-Type: application/json
{
"method" : "people.create",
"id" : "createFriend"
"params: {
"userId" : "@me",
"groupId" : "@friends",
"person" : {
"id" : "example.org:FF256337"
}
}
}
HTTP/1.x 207 Multi-Status
Content-Type: application/json
{
"result" : {
}
}