How to create new wave using active api

18 views
Skip to first unread message

mileesah

unread,
May 31, 2010, 12:22:59 PM5/31/10
to Google Wave API
Hi,

I don't know what i was doing wrong but i can't seem to make my code
work.. I wanted to create a new wave whenever i access a the page. It
doesnt return any exception so im kinda lost as to what the problem
is. Any help will be highly appreciated,


On my robot I have:
//constructor
public WaveRobot()
{

setupOAuth(CONSUMER_KEY, CONSUMER_SECRET, "http://www-
opensocial.googleusercontent.com/api/rpc");
setAllowUnsignedRequests(true);

}

And on my httpservlet I have:


public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException
{
resp.setContentType("text/plain");
resp.getWriter().println("alive");

WaveAssistantRobot robot =new WaveAssistantRobot();
Set<String> set = new HashSet<String>();
set.add("....@googlewave.com");
Wavelet wave =robot.newWave("wave.google.com",set);
wave.setTitle("Title");
java.util.List<JsonRpcResponse> test = robot.submit(wave, "http://
www-opensocial.googleusercontent.com/api/rpc");
}




Thanks

Ohad Redlich

unread,
Jun 1, 2010, 8:31:27 AM6/1/10
to Google Wave API
hi
several issues:
1. are u sure u have added YOURSELF as a participant in the set? if
not, you will see the new-created-wave in your inbox items.
2. the line: Wavelet wave =robot.newWave("wave.google.com",set);
i think that the domain is "googlewave.com"...
3. when u call "submit", try to use this RPC server URL: "http://
gmodules.com/api/rpc"

let me know if that helped :-)
-Ohad

mileesah

unread,
Jun 1, 2010, 8:41:45 AM6/1/10
to Google Wave API
thanks a lot. that worked for me.. I was using the rpc server that was
on the tutorial site..

thanks again..

Matias Molinas

unread,
Jun 3, 2010, 1:33:19 AM6/3/10
to google-...@googlegroups.com
What is correct? stocky sample:

private static String SANDBOX_DOMAIN = "wavesandbox.com";
private static String PREVIEW_DOMAIN = "googlewave.com";

private static String PREVIEW_RPC_URL = "http://gmodules.com/api/rpc";
private static String SANDBOX_RPC_URL = "http://sandbox.gmodules.com/api/rpc";

or Active API documentation:

* Sandbox: http://www-opensocial-sandbox.googleusercontent.com/api/rpc
* Preview: http://www-opensocial.googleusercontent.com/api/rpc

> --
> You received this message because you are subscribed to the Google Groups "Google Wave API" group.
> To post to this group, send email to google-...@googlegroups.com.
> To unsubscribe from this group, send email to google-wave-a...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en.
>
>

KnightYusuf

unread,
Jun 6, 2010, 8:27:15 AM6/6/10
to Google Wave API
thank you very much you deserve a 5 stars :)

On 1 juin, 13:31, Ohad Redlich <ohad.redl...@gmail.com> wrote:
> hi
> several issues:
> 1. are u sure u have added YOURSELF as a participant in the set? if
> not, you will see the new-created-wavein your inbox items.
> 2. the line: Waveletwave=robot.newWave("wave.google.com",set);
>     i think that the domain is "googlewave.com"...
> 3. when u call "submit", try to use this RPC server URL: "http://
> gmodules.com/api/rpc"
>
> let me know if that helped :-)
> -Ohad
>
> On May 31, 7:22 pm, mileesah <milee...@gmail.com> wrote:
>
> > Hi,
>
> > I don't know what i was doing wrong but i can't seem to make my code
> > work.. I wanted tocreatea newwavewhenever i access a the page. It
> > doesnt return any exception so im kinda lost as to what the problem
> > is. Any help will be highly appreciated,
>
> > On myrobotI have:
> > //constructor
> > public WaveRobot()
> > {
>
> >                  setupOAuth(CONSUMER_KEY, CONSUMER_SECRET, "http://www-
> > opensocial.googleusercontent.com/api/rpc");
> >                  setAllowUnsignedRequests(true);
>
> > }
>
> > And on my httpservlet I have:
>
> > public void doGet(HttpServletRequest req, HttpServletResponse resp)
> >                         throws IOException
> > {
> >                 resp.setContentType("text/plain");
> >                 resp.getWriter().println("alive");
>
> >                         WaveAssistantRobotrobot=new WaveAssistantRobot();
> >                         Set<String> set = new HashSet<String>();
> >                         set.add("....@googlewave.com");
> >                         Waveletwave=robot.newWave("wave.google.com",set);
> >                        wave.setTitle("Title");
> >                         java.util.List<JsonRpcResponse> test =robot.submit(wave, "http://
> > www-opensocial.googleusercontent.com/api/rpc");
>
> > }
>
> > Thanks
>
>

pamela (Google Employee)

unread,
Jun 6, 2010, 7:54:56 PM6/6/10
to google-...@googlegroups.com
Both should work, but the URLs in the documentation are preferred.

Drew LeSueur

unread,
Jun 6, 2010, 8:20:06 PM6/6/10
to Google Wave API
What about calling fetch_wavelet()

I tried this:
robot.fetch_wavelet('googlewave.com!w+dtuZi6t3C','googlewave.com!conv
+root')
robot.submit(wavelet)
self.response.out.write(wavelet.creator)

But I get http error 502 for googlewave.com (preview environment)

Any suggestions?

Thank you.

On Jun 6, 6:54 pm, "pamela (Google Employee)" <pamela...@gmail.com>
wrote:
> Both should work, but the URLs in the documentation are preferred.
>
> On Thu, Jun 3, 2010 at 3:33 PM, Matias Molinas <matias.moli...@gmail.com>wrote:
>
>
>
> > What is correct? stocky sample:
>
> >  private static String SANDBOX_DOMAIN = "wavesandbox.com";
> >  private static String PREVIEW_DOMAIN = "googlewave.com";
>
> >  private static String PREVIEW_RPC_URL = "http://gmodules.com/api/rpc";
> >  private static String SANDBOX_RPC_URL = "
> >http://sandbox.gmodules.com/api/rpc";
>
> >  or Active API documentation:
>
> >    *  Sandbox:
> >http://www-opensocial-sandbox.googleusercontent.com/api/rpc
> >    * Preview:http://www-opensocial.googleusercontent.com/api/rpc
>
> > google-wave-a...@googlegroups.com<google-wave-api%2Bunsubscribe@ googlegroups.com>
> > .
> > > For more options, visit this group at
> >http://groups.google.com/group/google-wave-api?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Wave API" group.
> > To post to this group, send email to google-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-wave-a...@googlegroups.com<google-wave-api%2Bunsubscribe@ googlegroups.com>
> > .

Léo SEI

unread,
Aug 3, 2010, 9:01:56 AM8/3/10
to Google Wave API
Hi,

I'm creating new waves thanks to the active api but I have a problem
retrieving the ID of the newly created wave.
All I get is a temporary id :(

Any ideas ?

Avishay Balderman

unread,
Aug 3, 2010, 9:14:39 AM8/3/10
to google-...@googlegroups.com
See the code below (WaveIdentity  is just a pojo which contains 2 strings)

private WaveIdentity getWaveId(List<JsonRpcResponse> response) 
{
for (JsonRpcResponse jsonRpcResponse : response) 
{
Map<ParamsProperty, Object> data = jsonRpcResponse.getData();
Object waveIdObj = data.get(ParamsProperty.WAVE_ID);
            Object waveletIdObj = data.get(ParamsProperty.WAVELET_ID);
if(waveIdObj != null && waveletIdObj != null)
{
String waveId =  (String)waveIdObj;
WaveIdentity waveletId = new WaveIdentity();
                // remove the prefix 'googlewave.com!'
waveletId.setWaveId(waveId.substring(WAVE_ID_PREFIX, waveId.length()));
waveletId.setWaveletId((String)waveletIdObj);
return waveletId;
}
return null;
}

To unsubscribe from this group, send email to google-wave-a...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en.




--
Avishay Balderman
Reply all
Reply to author
Forward
0 new messages