XML error for questions all_object_info_totals_by_date call

8 views
Skip to first unread message

Sentissi Mouad

unread,
Apr 30, 2014, 5:23:05 AM4/30/14
to allou...@googlegroups.com
Hello everyone, 

This API call : GET /questions/all_object_info_totals_by_date.xml?object_type=votes
returns something like :

<?xml version="1.0" encoding="UTF-8"?>
  <hash>
  <2014-02-15 type="integer">16</2014-02-15>
  <2014-02-16 type="integer">10</2014-02-16>
  <2014-02-18 type="integer">14</2014-02-18>
</hash>

with is an invalid xml : StartTag: invalid element name
tag name sarting with a number !

Does anybody has a fix for that ? 
Thanks very much

Mouad

Sentissi Mouad

unread,
Apr 30, 2014, 8:28:39 AM4/30/14
to allou...@googlegroups.com
This small hack right in the PW API does fix it :


hash = Vote.count(:group => "CONCAT('d',date(created_at))")

Luke Baker

unread,
Apr 30, 2014, 12:15:20 PM4/30/14
to allou...@googlegroups.com
Hi there,

We'll work to fix this. Chances are, we'll update the response to be
more like: https://github.com/allourideas/pairwise-api/wiki/questions-object_info_totals_by_date

I've started this work here:

https://github.com/allourideas/pairwise-api/commit/404e74d303012ce6d6b2b795c04d522780359535

I'll update this thread once the fix is available in the master branch.

Luke
> --
> You received this message because you are subscribed to the Google Groups
> "All Our Ideas" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to allourideas...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Sentissi Mouad

unread,
Apr 30, 2014, 2:15:30 PM4/30/14
to allou...@googlegroups.com
Thanks Luke.
Looking forward to see it in master.

Luke Baker

unread,
Apr 30, 2014, 2:42:19 PM4/30/14
to allou...@googlegroups.com
Okay, this fix is available on master. I've updated the documentation as well:

https://github.com/allourideas/pairwise-api/wiki/questions-all_object_info_totals_by_date

Luke

Sentissi Mouad

unread,
Apr 30, 2014, 2:48:18 PM4/30/14
to allou...@googlegroups.com
That was fast !
Will pull that asap.
Thanks again Luke.
Reply all
Reply to author
Forward
0 new messages