want to implement 'opensocial.requestSendMessage' function in Ruby <req. packet Structure ??>

1 view
Skip to first unread message

brucewa...@gmail.com

unread,
Jun 4, 2009, 4:14:04 AM6/4/09
to Orkut Developer Forum
Dear All,
I am testing with "OpenSocialRuby Client" library,
<http://code.google.com/p/opensocial-ruby-client/>
And I want to implement the 'opensocial.requestSendMessage'
function
available in JS library, by using "OpenSocial Ruby Client" library.
And I need help and suggestions.
When I send the 'friend list' request, the Http packet structure is
like this.
##########################
T 192.168.0.X:56978 -> orkut.com [AP]
GET /social/rest/people/@me/@friends?
xoauth_requestor_id=xxxxxxxxxxxxxx&fields=id,dateOfBirth,name,emails,gender ,state,postalCode,ethnicity,relationshipStatus,thumbnailUrl,displayName&oau
th_nonce=ZgOCrPcVTr9CFgIcY9PjPRuwQYUIz4awk776Q86us&oauth_signature_method=H
MACSHA1&oauth_timestamp=1244079737&oauth_consumer_key=orkut.com
%yyyyyyyyyyyy&oauth_version=1.0&oauth_signature=mLTd1%2Bc%2B%2FGak
%2BfmqLRui38c5ctI%3D HTTP/1.1..Connection: close..Accept: */*..Host:
sandbox.orkut.com....
##########################
According to the REST protocol spec,
<http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/
restful-protocol>
especially the section <10. Messaging (Optional)>,
I think I can make my own "requestSendMessage" function in the Ruby
Library.
(And of course, JS library already has it)
So maybe I need to send the Http POST (or PUT) request and the
content
of the Http packet should start with like following.. am I right?
##########################
PUT /social/rest/messages/{guid}/outbox
##########################
Anyway, I created a new class by examining the original
FetchPeopleRequest class, but there is no progress because I don't
know clearly about the 'proper' packet structure I need to send.
Or, is there any way more convenient?
Any suggestions or help will be appreciated.
Best regards.,
Bruce.

Shishir Birmiwal (Google)

unread,
Jun 5, 2009, 2:36:19 AM6/5/09
to Orkut Developer Forum
Bruce,

Orkut does not allow opensocial clients to post messages at present.
This may be the reason why this is not implemented.
You are, however, still free to implement that method and test on
shindig or something else.

Cheers,
Shishir


On Jun 4, 1:14 pm, "brucewang.ko...@gmail.com"

brucewa...@gmail.com

unread,
Jun 5, 2009, 2:46:43 AM6/5/09
to Orkut Developer Forum
Dear Shishir,

Thank you for your kind reply.

Do you mind if I ask you one more question?

Is there any document available regarding the exact HTTP request
payload structure is mentioned?
I am using opensocial-ruby-client library and totally new to
OpenSocial.
So, for me it is much simple if I know the message structure in Socket
level.

Actually I tried some with Ruby and I got 200 OK response from Orkut
(Even though that sendMessage is not yet implemented in Orkut. I
believe you are making it perfectly for end user's sake), but I am
just not sure my request message is really proper or not. If I know
that information then I can adopt to any future changes in RESTful
thing.

Anyway, thank you again.

Best regards.,

On Jun 5, 3:36 pm, "Shishir Birmiwal (Google)"

Shishir Birmiwal (Google)

unread,
Jun 16, 2009, 1:51:23 PM6/16/09
to Orkut Developer Forum
Dear Bruce,

I'd recommend using the json-rpc mechanism for querying. The spec is
here: http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/rpc-protocol.html
REST support is kind-of experimental and fully used by many at
present.

cheers,
shishir


On Jun 5, 11:46 am, "brucewang.ko...@gmail.com"
Reply all
Reply to author
Forward
0 new messages