Message from discussion
Posting to events giving weird results
Received: by 10.43.61.141 with SMTP id ww13mr1256342icb.6.1350522570712;
Wed, 17 Oct 2012 18:09:30 -0700 (PDT)
X-BeenThere: usergrid@googlegroups.com
Received: by 10.50.51.234 with SMTP id n10ls3633223igo.3.canary; Wed, 17 Oct
2012 18:09:30 -0700 (PDT)
Received: by 10.43.131.7 with SMTP id ho7mr8887854icc.5.1350522570163;
Wed, 17 Oct 2012 18:09:30 -0700 (PDT)
Received: by 10.43.131.7 with SMTP id ho7mr8887852icc.5.1350522570118;
Wed, 17 Oct 2012 18:09:30 -0700 (PDT)
Return-Path: <r...@apigee.com>
Received: from mail-ie0-f169.google.com (mail-ie0-f169.google.com [209.85.223.169])
by gmr-mx.google.com with ESMTPS id rf8si1975372igb.2.2012.10.17.18.09.30
(version=TLSv1/SSLv3 cipher=OTHER);
Wed, 17 Oct 2012 18:09:30 -0700 (PDT)
Received-SPF: neutral (google.com: 209.85.223.169 is neither permitted nor denied by domain of r...@apigee.com) client-ip=209.85.223.169;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.223.169 is neither permitted nor denied by domain of r...@apigee.com) smtp.mail=...@apigee.com
Received: by mail-ie0-f169.google.com with SMTP id 10so12599305ied.28
for <usergrid@googlegroups.com>; Wed, 17 Oct 2012 18:09:30 -0700 (PDT)
d=google.com; s=20120113;
h=date:from:to:message-id:in-reply-to:references:subject:x-mailer
:mime-version:content-type:x-gm-message-state;
bh=ITQ+8rWXgKG6tsCFAc2WGioRLB2JsZ73+Zude7sCTwc=;
b=QRALMneLineb+B9L4O2fp0Z6W4/ED4vVQuGsGUFwjS5e1aHEFxXj9zrCOqQk520sED
KgcFVTCPJdnQQDMwmLhXVEP/ZxeZKWjj5dU/JoamkyEAB2arf2ub0RqoxNS/pBpgtsaI
hQoWlI8RQxVCbexlaPbrCZ6u1odAszATOJ5ORSPrVkp5I4vwEQCWHP424YGyMrI/IG9k
dv6Kn0JhIa88bU50qI1MvBwo6ZUGqEZy153i9YmYFGDRiLQAIp+sxKOOIP7oSWaQsoPi
7+2v77qU43gHisN9JpiqgPZzloSuew8hH6Yu7+PZIjPFY45KfE/eLmwTq3ntQvzHGc5L
RzKg==
Received: by 10.50.219.233 with SMTP id pr9mr3426806igc.19.1350522569798;
Wed, 17 Oct 2012 18:09:29 -0700 (PDT)
Return-Path: <r...@apigee.com>
Received: from [192.168.0.4] (75-166-182-166.hlrn.qwest.net. [75.166.182.166])
by mx.google.com with ESMTPS id gs6sm13062337igc.11.2012.10.17.18.09.27
(version=SSLv3 cipher=OTHER);
Wed, 17 Oct 2012 18:09:28 -0700 (PDT)
Date: Wed, 17 Oct 2012 19:09:26 -0600
From: Rod Simpson <r...@apigee.com>
To: usergrid@googlegroups.com
Message-ID: <BA703F1043B546038FEC2ED0B9239...@apigee.com>
In-Reply-To: <0fe30e77-bf1d-403d-8a40-6692e33448e6@googlegroups.com>
References: <05ddf41b-f44d-43eb-9abf-5fa8d922bec0@googlegroups.com>
<CAAQGUJfe86tQOsWQmWcu8kGfALKNy708nZNaRJxuaF2CxXp...@mail.gmail.com>
<CAAQGUJdqZdEe3Y2Cs3EXbO-T0qBgyZGqFXKG-0NWQsSMSXo...@mail.gmail.com>
<0fe30e77-bf1d-403d-8a40-6692e33448e6@googlegroups.com>
Subject: Re: [usergrid] Posting to events giving weird results
X-Mailer: sparrow 1.6.1 (build 1081.52)
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="507f56c6_10f27d8c_570"
X-Gm-Message-State: ALoCoQm/T/XOl527iVFyIYNsRv7ApVbjGTImqPVD1SedPEm2QMq8AqAA6oS1BLPUJ3Ws6iUnMVBw
--507f56c6_10f27d8c_570
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Jerry, =20
I don't think you need to look for events. Events are in a first-in, fir=
st-out queue, and are removed once accessed. It sounds like what you are =
looking for is a counter. On this page:
http://apigee.com/docs/usergrid/content/events-and-counters
See the section called =22Retrieving counter data=22, about 3/4 of the wa=
y down the page. That will show you how to do this. But based on what y=
ou have below, something like this will work:
GET https://api.usergrid.com/MyOrg/MyApp/counters=3Fcounter=3Dad=5Fclicks=
There are other ways to hone the search, for example, if you wanted to se=
e just the clicks between a certain time period.
Rod =20
-- =20
Rod Simpson
apigee =20
skype: rockerston =20
twitter: rockerston =20
m: 303.859.7323
On Wednesday, October 17, 2012 at 6:38 PM, jerry hamby wrote:
> Has this bug of disappearing events been fixed=3F =20
> I'm now testing some code and I still can't get an event to stick aroun=
d so I can count user clicks.
> Is your online =22Events and counters=22 docs current=3F =20
> I'm attempting to create a =22System-defined event=22 and I'm following=
the direction of the docs.
> =20
> All my current returned results look exactly like what I was receiving =
back in August.
> =20
> My REST statement:
> https://api.usergrid.com/MyOrg/MyApp/events=3Faccess=5Ftoken=3DYWMtYdGe=
Pxi5EeKPwALoGuZA3AAAATp2Yu=5FgYOpDf=46eIWE7w-jxw--9-p-lNgzw&=7B=22categor=
y=22:=22Messages=22,=22counters=22:=7B=22group=22:=2233af4cf4-f6bd-67e1-a=
18-12387dabcda26=22,=22ad=5Fclicks=22:1,=22user=22:=2264af4cf4-f6bd-67e1-=
a566-12387d08da26=22=7D,=22timestamp=22:0=7D
> =20
> =20
> Jerry
> =20
> =20
> On =46riday, August 24, 2012 3:24:04 PM UTC-7, Tim Anglade wrote:
> > On second thought, I do see the counters in your JSON and yes it woul=
d make sense to use the Events for that, my bad.
> > =20
> > It=E2=80=99s not immediately clear to me why Events would have this c=
ounter feature built in and then behave like a queue so it looks like we =
have a bug there and should persist things more traditionally. I=E2=80=99=
ve opened a bug report about this so we can turn the Events back to stayi=
ng in the queue, even if you GET them repeatedly. Thanks for reporting th=
is=21 =20
> > =20
> > Cheers,
> > Tim
> > =20
> > On =46ri, Aug 24, 2012 at 3:05 PM, Tim Anglade <t...=40apigee.com (ja=
vascript:)> wrote:
> > > Hi Jerry, thanks for bringing this to our attention. Events are ano=
ther special collection in Usergrid. It functions like a message queue, m=
eaning that reading from the queue will =E2=80=9Cpop=E2=80=9D elements ou=
t of it as they are consumed. In essence what could have happened was tha=
t the element was properly inserted on the post, and the first GET will h=
ave rendered it (and removed it). Subsequent GETs would see nothing altho=
ugh you do see in the response a =E2=80=9Clast=E2=80=9D UUID that should =
point to the Event you inserted. (We have a bunch of internal documentati=
on around this that we need to expose publicly asap.)
> > > =20
> > > The issue with the counter is different: mainly it=E2=80=99s that t=
hese counters only track the number of object creations, not the current =
number of objects available at any given endpoint.
> > > =20
> > > =46rom what I see in the JSON above, it looks like what you are try=
ing to achieve may be better done through a regular Collection in Usergri=
d. Any reason in particular why you were looking at Events to power this =
part of your use-case=3F =20
> > > =20
> > > Cheers,
> > > Tim
> > > =20
> > > =20
> > > On =46ri, Aug 17, 2012 at 1:05 PM, jerry hamby <jerry...=40gmail.co=
m (javascript:)> wrote:
> > > > =20
> > > > I have tried to reproduce the =22Create a new event=22 example fo=
und in the docs.
> > > > =20
> > > > =20
> > > > =20
> > > > I'm testing this against the =22sandbox=22 and =22mytestapp=22.
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > If I go to Admin Portal, under Collections:Events it shows I have=
X number of events stored.
> > > > =20
> > > > =20
> > > > If I drill down into Events, there are no events there.
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > See my code below for the way I did the POST.
> > > > =20
> > > > =20
> > > > I'm using this style of packaging content with other collections =
and they are all working fine.
> > > > =20
> > > > =20
> > > > What am I doing wrong=3F =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > Jerry
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > > > =20
> > > > =20
> > > > mBuildEvent(=22advertising=22);
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > function mBuildEvent(vCatName) =7B =20
> > > > =20
> > > > =20
> > > > vEvent=3Dnew Object();
> > > > =20
> > > > =20
> > > > vEvent.timestamp =3D 0;
> > > > =20
> > > > =20
> > > > vEvent.category =3D vCatName;
> > > > =20
> > > > =20
> > > > vClicks=3Dnew Object();
> > > > =20
> > > > =20
> > > > vClicks.ad=5Fclicks =3D 5;
> > > > =20
> > > > =20
> > > > vEvent.counters =3D vClicks;
> > > > =20
> > > > =20
> > > > mPostEvent(vEvent);
> > > > =20
> > > > =20
> > > > =7D;
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > > > =20
> > > > =20
> > > > function mPostEvent(vObj) =7B =20
> > > > =20
> > > > =20
> > > > if (pBearerToken =21=3D =22=22)=7B
> > > > =20
> > > > =20
> > > > var vTempObject =3D JSON.stringify(vObj);
> > > > =20
> > > > =20
> > > > var ajax =3D new XMLHttpRequest();
> > > > =20
> > > > =20
> > > > ajax.open('POST',('https://api.usergrid.com/MyOrg/'+pTheAppName+'=
/events/=3Faccess=5Ftoken=3D'+pBearerToken));
> > > > =20
> > > > =20
> > > > ajax.send(vTempObject);
> > > > =20
> > > > =20
> > > > =7D
> > > > =20
> > > > =20
> > > > =7D;
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D returned results after doing a POST =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > > > =20
> > > > =20
> > > > apigee.js:: mPostEvent success ajax.responseText =3D =7B
> > > > =20
> > > > =20
> > > > =22action=22 : =22post=22,
> > > > =20
> > > > =20
> > > > =22application=22 : =22fg22ed89-e7cf-44r5-96f7-12313b06d222=22,=
> > > > =20
> > > > =20
> > > > =22params=22 : =7B
> > > > =20
> > > > =20
> > > > =22access=5Ftoken=22 : =5B =22YAMtl2lhpeihAeGW9hIxAmbSEgAAATk=
7NGLRQx6qGM-7CiOZtInfTVGcq9IujKc=22 =5D
> > > > =20
> > > > =20
> > > > =7D,
> > > > =20
> > > > =20
> > > > =22path=22 : =22/events=22,
> > > > =20
> > > > =20
> > > > =22uri=22 : =22https://usergrid-dev-api.elasticbeanstalk.com/fg=
22ed89-e7cf-44r5-96f7-12313b06d222/events=22,
> > > > =20
> > > > =20
> > > > =22entities=22 : =5B =7B
> > > > =20
> > > > =20
> > > > =22uuid=22 : =22e257ccc6-586f-1c61-bdd0-956c65494c85=22,
> > > > =20
> > > > =20
> > > > =22type=22 : =22event=22,
> > > > =20
> > > > =20
> > > > =22metadata=22 : =7B
> > > > =20
> > > > =20
> > > > =22path=22 : =22/events/e257bbc6-586f-1c62-bdd0-956c65494c9=
5=22
> > > > =20
> > > > =20
> > > > =7D
> > > > =20
> > > > =20
> > > > =7D =5D,
> > > > =20
> > > > =20
> > > > =22timestamp=22 : 1345231653540,
> > > > =20
> > > > =20
> > > > =22duration=22 : 368
> > > > =20
> > > > =20
> > > > =7D at file:///android=5Fasset/www/js/apigee.js:1016
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > =20
> > > > //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D Curl results =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > > > =20
> > > > =20
> > > > MacPro:=7E macuser=24 curl -X GET =22https://api.usergrid.com/MyO=
rg/mytestapp/events=22
> > > > =20
> > > > =20
> > > > =7B
> > > > =20
> > > > =20
> > > > =22path=22 : =22/events/=22,
> > > > =20
> > > > =20
> > > > =22queue=22 : =229dc26782-6904-47c4-9abc-844172ad2ed9=22,
> > > > =20
> > > > =20
> > > > =22messages=22 : =5B =5D,
> > > > =20
> > > > =20
> > > > =22last=22 : =22e257bbc6-586f-1c62-bdd0-956c65494c95=22
> > > > =20
> > > > =20
> > > > =7D =20
> > > > =20
> > > > =20
> > > > -- You received this message because you are subscribed to the Go=
ogle Groups Usergrid group. To post to this group, send email to user...=40=
googlegroups.com (javascript:). To unsubscribe from this group, send emai=
l to usergrid+u...=40googlegroups.com (javascript:). =46or more options, =
visit this group at https://groups.google.com/d/forum/usergrid=3Fhl=3Den
> > > > =20
> > > > Learn more about Apigee Usergrid at http://apigee.com/about/produ=
cts/usergrid
> > > > =20
> > > > =46ork Usergrid on GitHub: https://github.com/usergrid/stack
> > =20
> -- You received this message because you are subscribed to the Google G=
roups Usergrid group. To post to this group, send email to usergrid=40goo=
glegroups.com (mailto:usergrid=40googlegroups.com). To unsubscribe from t=
his group, send email to usergrid+unsubscribe=40googlegroups.com (mailto:=
usergrid+unsubscribe=40googlegroups.com). =46or more options, visit this =
group at https://groups.google.com/d/forum/usergrid=3Fhl=3Den
> =20
> Learn more about Apigee Usergrid at http://apigee.com/about/products/us=
ergrid
> =20
> =46ork Usergrid on GitHub: https://github.com/usergrid/stack =20
--507f56c6_10f27d8c_570
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<div>
Jerry,
</div><div><br></div><div>I don't think you need to look =
for events. Events are in a first-in, first-out queue, and are remo=
ved once accessed. It sounds like what you are looking for is a counter. =
On this page:</div><div><br></div><div><a href=3D=22http://apigee.c=
om/docs/usergrid/content/events-and-counters=22>http://apigee.com/docs/us=
ergrid/content/events-and-counters</a></div><div><br></div><div>See the s=
ection called =22Retrieving counter data=22, about 3/4 of the way down th=
e page. That will show you how to do this. But based on what =
you have below, something like this will work:</div><div><br></div><div>G=
ET https://api.usergrid.com/MyOrg/MyApp/counters=3Fcounter=3Dad=5Fclicks<=
/div><div><br></div><div>There are other ways to hone the search, for exa=
mple, if you wanted to see just the clicks between a certain time period.=
</div><div><br></div><div><br></div><div>Rod</div>
<div><div><br></div><br>
<div class=3D=22moz-signature=22>-- <br><b>Rod Simpson</b><br>
<b><span style=3D=22color:rgb(255,102,0)=22>api</span><span style=3D=22co=
lor:rgb(102,102,102)=22>gee</span>
</b><br>
<b><span style=3D=22color:rgb(0,175,240)=22>skype:</span></b> rockerston
<br>
<b><span style=3D=22color:rgb(64,153,255)=22>twitter:</span></b> rockerst=
on
<br>
<span style=3D=22color:rgb(102,102,102)=22>m: 303.859.7323</span></div><d=
iv><br></div></div>
=20
<p style=3D=22color: =23A0A0A8;=22>On Wednesday, October =
17, 2012 at 6:38 PM, jerry hamby wrote:</p>
<blockquote type=3D=22cite=22 style=3D=22border-left-styl=
e:solid;border-width:1px;margin-left:0px;padding-left:10px;=22>
<span><div><div>Has this bug of disappearing events b=
een fixed=3F <div>I'm now testing some code and I still can't get an=
event to stick around so I can count user clicks.</div><div>Is your onli=
ne =22Events and counters=22 docs current=3F </div><div>I'm attempti=
ng to create a =22System-defined event=22 and I'm following the direction=
of the docs.</div><div><br></div><div>All my current returned results lo=
ok exactly like what I was receiving back in August.</div><div><br></div>=
<div>My REST statement:</div><div><p style=3D=22margin: 0.0px 0.0px 0.0px=
0.0px; font: 11.0px Monaco=22><span><a href=3D=22https://api.usergrid.co=
m/MyOrg/MyApp/events=3Faccess=5Ftoken=3DYWMtYdGePxi5EeKPwALoGuZA3AAAATp2Y=
u=5FgYOpDf=46eIWE7w-jxw--9-p-lNgzw&=7B=22>https://api.usergrid.com/My=
Org/MyApp/events=3Faccess=5Ftoken=3DYWMtYdGePxi5EeKPwALoGuZA3AAAATp2Yu=5F=
gYOpDf=46eIWE7w-jxw--9-p-lNgzw&=7B</a>=22category=22:=22Messages=22,=22=
counters=22:=7B=22group=22:=22</span>33af4cf4-f6bd-67e1-a18-12387dabcda26=
<span>=22,=22ad=5Fclicks=22:1,=22user=22:=2264af4cf4-f6bd-67e1-a566-12387=
d08da26=22=7D,=22timestamp=22:0=7D</span></p></div><div><br></div><div>Je=
rry<br><div> <br><br>On =46riday, August 24, 2012 3:24:04 PM UTC-7, =
Tim Anglade wrote:<blockquote type=3D=22cite=22><div>On second thought, I=
do see the counters in your JSON and yes it would make sense to use the =
Events for that, my bad.<div><br></div><div>It=E2=80=99s not immediately =
clear to me why Events would have this counter feature built in and then =
behave like a queue so it looks like we have a bug there and should persi=
st things more traditionally. I=E2=80=99ve opened a bug report about this=
so we can turn the Events back to staying in the queue, even if you GET =
them repeatedly. Thanks for reporting this=21</div>
<div><br></div><div>Cheers,</div><div>Tim<br><br><div>On =46ri, Aug 24, 2=
012 at 3:05 PM, Tim Anglade <span dir=3D=22ltr=22><<a href=3D=22javasc=
ript:=22 target=3D=22=5Fblank=22 gdf-obfuscated-mailto=3D=22D26wCJsfSdYJ=22=
>t...=40apigee.com</a>></span> wrote:<br><blockquote type=3D=22cite=22=
><div>Hi Jerry, thanks for bringing this to our attention. Events are ano=
ther special collection in Usergrid. It functions like a message queue, m=
eaning that reading from the queue will =E2=80=9Cpop=E2=80=9D elements ou=
t of it as they are consumed. In essence what could have happened was tha=
t the element was properly inserted on the post, and the first GET will h=
ave rendered it (and removed it). Subsequent GETs would see nothing altho=
ugh you do see in the response a =E2=80=9Clast=E2=80=9D UUID that should =
point to the Event you inserted. (We have a bunch of internal documentati=
on around this that we need to expose publicly asap.)<div>
<br></div><div>The issue with the counter is different: mainly it=E2=80=99=
s that these counters only track the number of object creations, not the =
current number of objects available at any given endpoint.<br><div><br></=
div><div>
=46rom what I see in the JSON above, it looks like what you are trying to=
achieve may be better done through a regular Collection in Usergrid. Any=
reason in particular why you were looking at Events to power this part o=
f your use-case=3F</div>
<div><br><div>Cheers,</div><div>Tim<div><div><br><br><div>On =46ri, Aug 1=
7, 2012 at 1:05 PM, jerry hamby <span dir=3D=22ltr=22><<a href=3D=22ja=
vascript:=22 target=3D=22=5Fblank=22 gdf-obfuscated-mailto=3D=22D26wCJsfS=
dYJ=22>jerry...=40gmail.com</a>></span> wrote:<br><blockquote type=3D=22=
cite=22><div><p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22=
>I have tried to reproduce the =22Create a new event=22 example found in =
the docs.<br>
</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22>I'm testing=
this against the =22sandbox=22 and =22mytestapp=22.</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica;min-height:14.=
0px=22><br></p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22>If I go to =
Admin Portal, under Collections:Events it shows I have X number of events=
stored.</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22>If I drill =
down into Events, there are no events there.</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica;min-height:14.=
0px=22><br></p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22>See my code=
below for the way I did the POST.</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22>I'm using t=
his style of packaging content with other collections and they are all wo=
rking fine.</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22>What am I d=
oing wrong=3F </p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica;min-height:14.=
0px=22><br></p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22>Jerry</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco;color:=23539172;m=
in-height:15.0px=22><br></p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco;color:=23539172;m=
in-height:15.0px=22><br></p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco;color:=23539172=22=
>//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D<wbr>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<wbr>=3D=3D=3D=3D=3D=3D</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22>mBuildEvent(<s=
pan style=3D=22color:=234b00fe=22>=22advertising=22</span>);</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco;min-height:15.0px=
=22><br></p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22color:=238f0268=22>function</span> mBuildEvent(vCatName) =7B </p>=
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22white-space:pre-wrap=22> </span>vEvent=3D<span style=3D=22color:=238f0=
268=22>new</span> Object();</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22white-space:pre-wrap=22> </span>vEvent.timestamp =3D 0;</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22white-space:pre-wrap=22> </span>vEvent.category =3D vCatName;</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22white-space:pre-wrap=22> </span> vClicks=3D<span style=3D=22colo=
r:=238f0268=22>new</span> Object();</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22white-space:pre-wrap=22> </span> vClicks.ad=5Fclicks =3D 5;</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22white-space:pre-wrap=22> </span>vEvent.counters =3D vClicks;</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22white-space:pre-wrap=22> </span>mPostEvent(vEvent);</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22>=7D;</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco;min-height:15.0px=
=22><br></p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco;color:=23539172=22=
>//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D<wbr>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<wbr>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22color:=238f0268=22>function</span> mPostEvent(vObj) =7B </p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22white-space:pre-wrap=22> </span><span style=3D=22color:=238f0268=22>if=
</span> (pBearerToken =21=3D <span style=3D=22color:=234b00fe=22>=22=22</=
span>)=7B</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22white-space:pre-wrap=22> </span><span style=3D=22color:=238f0268=22>v=
ar</span> vTempObject =3D JSON.stringify(vObj);</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22white-space:pre-wrap=22> </span><span style=3D=22color:=238f0268=22>v=
ar</span> ajax =3D <span style=3D=22color:=238f0268=22>new</span> XMLHttp=
Request();</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco;color:=234b00fe=22=
><span style=3D=22color:=23000000=22><span style=3D=22white-space:pre-wra=
p=22> </span>ajax.open(</span>'POST'<span style=3D=22color:=23000000=22>=
,(</span>'<a href=3D=22https://api.usergrid.com/MyOrg/=22 target=3D=22=5F=
blank=22>https://<wbr>api.usergrid.com/MyOrg/</a>'<span style=3D=22color:=
=23000000=22>+<wbr>pTheAppName+</span>'/events/=3Faccess=5F<wbr>token=3D'=
<span style=3D=22color:=23000000=22>+pBearerToken));</span></p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22white-space:pre-wrap=22> </span>ajax.send(vTempObject);</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22><span style=3D=
=22white-space:pre-wrap=22> </span>=7D</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco=22>=7D;</p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco;min-height:15.0px=
=22><br></p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco;min-height:15.0px=
=22><br></p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco;color:=23539172=22=
>//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D returned results after doing a POST =3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22>apigee.js::=
mPostEvent success ajax.responseText =3D =7B</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =22a=
ction=22 : =22post=22,</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =22a=
pplication=22 : =22fg22ed89-e7cf-44r5-96f7-<wbr>12313b06d222=22,</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =22p=
arams=22 : =7B</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> &nbs=
p; =22access=5Ftoken=22 : =5B =22<wbr>YAMtl2lhpeihAeGW9hIxAmbSEgAAAT<wbr>=
k7NGLRQx6qGM-<wbr>7CiOZtInfTVGcq9IujKc=22 =5D</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =7D,=
</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =22p=
ath=22 : =22/events=22,</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =22u=
ri=22 : =22<a href=3D=22https://usergrid-dev-api.elasticbeanstalk.com/fg2=
2ed89-e7cf-44r5-96f7-12313b06d222/events=22 target=3D=22=5Fblank=22>https=
://usergrid-dev-api.<wbr>elasticbeanstalk.com/fg22ed89-<wbr>e7cf-44r5-96f=
7-12313b06d222/<wbr>events</a>=22,</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =22e=
ntities=22 : =5B =7B</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> &nbs=
p; =22uuid=22 : =22e257ccc6-586f-1c61-bdd0-<wbr>956c65494c85=22,</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> &nbs=
p; =22type=22 : =22event=22,</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> &nbs=
p; =22metadata=22 : =7B</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> &nbs=
p; =22path=22 : =22/events/e257bbc6-586f-1c62-<wbr>bdd0-956c65494c=
95=22</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> &nbs=
p; =7D</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =7D =
=5D,</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =22t=
imestamp=22 : 1345231653540,</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =22d=
uration=22 : 368</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22>=7D at file=
:///android=5Fasset/www/js/<wbr>apigee.js:1016</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica;min-height:14.=
0px=22><br></p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica;min-height:14.=
0px=22><br></p>
<p style=3D=22margin:0px 0px 0px 0px;font:11.0px Monaco;color:=23539172=22=
>//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D Curl results =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<wbr>=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22>MacPro:=7E =
macuser=24 curl -X GET =22<a href=3D=22https://api.usergrid.com/MyOrg/myt=
estapp/events=22 target=3D=22=5Fblank=22>https://api.usergrid.com/<wbr>My=
Org/mytestapp/events</a>=22</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22>=7B</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =22p=
ath=22 : =22/events/=22,</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =22q=
ueue=22 : =229dc26782-6904-47c4-9abc-<wbr>844172ad2ed9=22,</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =22m=
essages=22 : =5B =5D,</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22> =22l=
ast=22 : =22e257bbc6-586f-1c62-bdd0-<wbr>956c65494c95=22</p>
<p style=3D=22margin:0px 0px 0px 0px;font:12.0px Helvetica=22>=7D </=
p><div><br></div>
<p></p>
-- You received this message because you are subscribed to the Google Gro=
ups Usergrid group. To post to this group, send email to <a href=3D=22jav=
ascript:=22 target=3D=22=5Fblank=22 gdf-obfuscated-mailto=3D=22D26wCJsfSd=
YJ=22>user...=40googlegroups.com</a>. To unsubscribe from this group, sen=
d email to <a href=3D=22javascript:=22 target=3D=22=5Fblank=22 gdf-obfusc=
ated-mailto=3D=22D26wCJsfSdYJ=22>usergrid+u...=40<wbr>googlegroups.com</a=
>. =46or more options, visit this group at <a href=3D=22https://groups.go=
ogle.com/d/forum/usergrid=3Fhl=3Den=22 target=3D=22=5Fblank=22>https://gr=
oups.google.com/d/<wbr>forum/usergrid=3Fhl=3Den</a><br>
<br>
Learn more about Apigee Usergrid at <a href=3D=22http://apigee.com/about/=
products/usergrid=22 target=3D=22=5Fblank=22>http://apigee.com/about/<wbr=
>products/usergrid</a><br>
<br>
=46ork Usergrid on GitHub: <a href=3D=22https://github.com/usergrid/stack=
=22 target=3D=22=5Fblank=22>https://github.com/usergrid/<wbr>stack</a></d=
iv></blockquote></div><br>
</div></div></div></div></div>
</div></blockquote></div><br></div>
</div></blockquote></div></div>
<p></p>
-- You received this message because you are subscribed to the Google Gro=
ups Usergrid group. To post to this group, send email to <a href=3D=22mai=
lto:usergrid=40googlegroups.com=22>usergrid=40googlegroups.com</a>. To un=
subscribe from this group, send email to <a href=3D=22mailto:usergrid+uns=
ubscribe=40googlegroups.com=22>usergrid+unsubscribe=40googlegroups.com</a=
>. =46or more options, visit this group at <a href=3D=22https://groups.go=
ogle.com/d/forum/usergrid=3Fhl=3Den=22>https://groups.google.com/d/forum/=
usergrid=3Fhl=3Den</a><br>
<br>
Learn more about Apigee Usergrid at <a href=3D=22http://apigee.com/about/=
products/usergrid=22>http://apigee.com/about/products/usergrid</a><br>
<br>
=46ork Usergrid on GitHub: <a href=3D=22https://github.com/usergrid/stack=
=22>https://github.com/usergrid/stack</a></div></div></span>
=20
=20
=20
=20
</blockquote>
=20
<div>
<br>
</div>
--507f56c6_10f27d8c_570--