On Fri, Apr 23, 2010 at 5:15 PM, RAVINDER MAAN <[email protected]> wrote:
> Hello All
Hoi RAVINDER MAAN,
> I am creating a new wave by using Active Robot API by using following
> code.
>
> Wavelet wavelet = robot.newWave("wavesandbox.com",participantList);
> wavelet.setTitle("Title");
> Blip rootBlip = wavelet.getRootBlip();
> rootBlip.append("Content of the wave");
> robot.submit(wavelet, "http://sandbox.gmodules.com/api/rpc");
> LOG.severe("Wave Id = " +wavelet.getWaveId().getId());
>
> After creating wave i want to find out its waveId.But when i try
> to get its waveid as u can see i am trying to log waveid of new wave
> it doesn`t log actual wave id instead it logs id`s like "Wave Id =
> TBD_-1968122361" .I know how to get wave id of new wave in previous
> API.Can anybody tell me how to get waveId of new wave through recent
> version 2 API. I want to store the waveId in database for future use.
> Thanks In advance.
robot.submit() returns a list of ids, in my log it looks like this:
submit returned:[{u'data': {u'waveletId': u'googlewave.com!conv+root',
u'blipId': u'b+v7BXJrZk19', u'message': None, u'waveId':
u'googlewave.com!w+v7BXJrZk18'}, u'id': u'op18'}, {u'data': {}, u'id':
u'op19'}, {u'data': {}, u'id': u'op20'}, {u'data': {}, u'id':
u'op21'}, {u'data': {}, u'id': u'op22'}, {u'data': {}, u'id':
u'op23'}, {u'data': {u'blipId': u'b+v7BXJrZk19', u'newBlipId':
u'b+v7BXJrZk1-'}, u'id': u'op24'}, {u'data': {}, u'id': u'op25'}]
you need to loop over this list and catch the waveId from it:
for item in wavelist:
try:
waveid = item['data']['waveId']
except (KeyError, ValueError):
continue
hope this helps ;]
Bart
--
You received this message because you are subscribed to the Google Groups
"Google Wave API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-wave-api?hl=en.