+CC shindig-dev That sounds like a great solution to this problem; We were already thinking about maybe making the client libraries version aware, but I much prefer solving it on the server side so that other client implementations just-work as well.
Shindig-dev: How do you guys feel about this? Would this be worth duplicating in java-shindig too? -- Chris On Tue, Jun 16, 2009 at 3:59 PM, Jinhui Du <dujin...@google.com> wrote: > Hi Chris > > I just looked into the code again. We can make the shindig JSON code to be > compatible with the old api to prevent the client libraries from failing. > If the JSON rpc request contains the 'message' param we assume it is using > the old api to request and set the msgCollId to "@outbox". > I create a change list please review it. > http://codereview.appspot.com/74064. Sorry for the delay. > > > > > On Wed, Jun 10, 2009 at 4:23 PM, Chris Chabot <chab...@google.com> wrote: > >> So the conclusion is that the php client library (as well as the perl, >> python, java and ruby ones) use the old messaging format and they need to >> get updated to use the msgCollId and new entity structure, right? >> >> Guess we need a new config in those client library to indicate what >> version of OpenSocial the SNS supports >> >> -- Chris >> >> >> On Wed, Jun 10, 2009 at 6:15 AM, Jinhui Du <dujin...@google.com> wrote: >> >>> Hi Anash >>> >>> I'm not familiar with opensocial php client. I just post the data to my >>> local partuza(from the svn trunk). It gives the error message "Can't parse >>> message.". >>> >>> For message service the content of the creation operation can be a >>> message or a message collection. So the parameter name is changed from >>> "message" to "entity". >>> >>> Also there is an extra "msgCollId" field in the "params" to make the >>> JSON RPC and REST implementation simple and consistent. >>> >>> I changed the post data to: >>> [{"method":"messages.create","params":{"userId": >>> ["1311"],"groupId":"@self","appId":"@app", "msgCollId":"@outbox", >>> "entity":{"recipients": [1],"body":"test message by osapi","title":"send >>> at 04:47:22","type":"PRIVATE_MESSAGE","types": >>> ["EMAIL","NOTIFICATION","PRIVATE_MESSAGE","PUBLIC_MESSAGE"]}}, >>> "id":"createMessage"}] . >>> >>> My local partuza returns: >>> [{"id":"createMessage","data":{"id":131,"title":"send at >>> 04:47:22","total":0,"unread":0,"updated":1244606857}}] >>> >>> Best regards. >>> >>> >>> On Tue, Jun 9, 2009 at 7:57 PM, Anash <api.an...@gmail.com> wrote: >>> >>>> >>>> Hi, >>>> >>>> I'm using php opensocial client library to create messages on partuza. >>>> I get an error from the server about an undefined index: >>>> >>>> Undefined index: title in <b>/var/www/html/partuza/Shindig/ >>>> PartuzaDbFetcher.php</b> on line <b>417</b> >>>> >>>> Can someone have a look and suggest what might be wrong? My HTTP >>>> request and responses from the log are are pasted below: >>>> >>>> [INFO][Tue, 09 Jun 09 04:47:51 -0700] - HTTP Request >>>> [INFO][Tue, 09 Jun 09 04:47:51 -0700] - >>>> array(4) { >>>> ["url"]=> >>>> string(336) "http://modules.partuza.nl/social/rpc? >>>> >>>> oauth_nonce=37fc256759e13daca7cefe49a11d3b0e&oauth_version=1.0&oauth_timestamp=1244548071&oauth_consumer_key=dff1f9e1- >>>> d6cf-c9e8-abd1- >>>> >>>> d4eccfeacbdf&xoauth_requestor_id=1311&oauth_body_hash=N0sEN9PSoygFDikKXnYUDWN4zW4%3D&oauth_signature_method=HMAC- >>>> SHA1&oauth_signature=inDmWXe%2BuuEAgW6gLSPPuvEFqkE%3D<http://modules.partuza.nl/social/rpc?%0Aoauth_nonce=37fc256759e13daca7cefe49a11d3b0e&oauth_version=1.0&oauth_timestamp=1244548071&oauth_consumer_key=dff1f9e1-%0Ad6cf-c9e8-abd1-%0Ad4eccfeacbdf&xoauth_requestor_id=1311&oauth_body_hash=N0sEN9PSoygFDikKXnYUDWN4zW4%3D&oauth_signature_method=HMAC-%0ASHA1&oauth_signature=inDmWXe%2BuuEAgW6gLSPPuvEFqkE%3D> >>>> " >>>> ["method"]=> >>>> string(4) "POST" >>>> ["body"]=> >>>> string(313) "[{"method":"messages.create","params":{"userId": >>>> ["1311"],"groupId":"@self","appId":"@app","message":{"recipients": >>>> [1],"body":"test message by osapi","title":"send at >>>> 04:47:51","type":"PRIVATE_MESSAGE","types": >>>> >>>> ["EMAIL","NOTIFICATION","PRIVATE_MESSAGE","PUBLIC_MESSAGE"]},"msgCollId":"inbox"},"id":"createMessage"}]" >>>> ["headers"]=> >>>> array(1) { >>>> [0]=> >>>> string(30) "Content-Type: application/json" >>>> } >>>> } >>>> >>>> [INFO][Tue, 09 Jun 09 04:47:52 -0700] - HTTP Response >>>> [INFO][Tue, 09 Jun 09 04:47:52 -0700] - >>>> array(3) { >>>> ["http_code"]=> >>>> int(200) >>>> ["data"]=> >>>> string(169) "<br /> >>>> <b>Notice</b>: Undefined index: title in <b>/var/www/html/partuza/ >>>> Shindig/PartuzaDbFetcher.php</b> on line <b>417</b><br /> >>>> [{"id":"createMessage","data":null}]" >>>> ["headers"]=> >>>> array(1) { >>>> [0]=> >>>> string(30) "Content-Type: application/json" >>>> } >>>> } >>>> >>>> Thanks, >>>> Anash >>>> >>>> >>> >>> >>> >> >> --~--~---------~--~----~------------~-------~--~----~ >> You received this message because you are subscribed to the Google Groups >> "Partuza" group. >> To post to this group, send email to part...@googlegroups.com >> To unsubscribe from this group, send email to >> partuza+unsubscr...@googlegroups.com<partuza%2bunsubscr...@googlegroups.com> >> For more options, visit this group at >> http://groups.google.com/group/partuza?hl=en >> -~----------~----~----~----~------~----~------~--~--- >> >> >