Search endpoint min_uploaded_at parameter

11 views
Skip to first unread message

Chris Lukic

unread,
Mar 22, 2014, 3:45:30 PM3/22/14
to magellan-acti...@googlegroups.com
Attempting to use the search API endpoint to retrieve latest since the last syncronization. The uploaded_at parameter seems well suited to this task, but I'm having difficulty getting the request to validate:

The following returns a bad request error:
https:// active-api.magellangps.com/ my-api-key/ fitness/ latest/ activities/search .json ?min_uploaded_at=2014-01-01T10:10:10Z&provider=magellan &access_token=my-access-token

However if I specify the date using the identical format for the field: max_performed_at or min_performed_at it works as expected.  

As an additional note while min_performed_at and max_performed_at work as expected returning the correct number of results, the field max_updated_at and min_updated_at return zero results when one field is specified and the other is left blank.







ape...@magellangps.com

unread,
Mar 25, 2014, 3:27:22 PM3/25/14
to magellan-acti...@googlegroups.com
Chris,

The following returns a bad request error:
https:// active-api.magellangps.com/ my-api-key/ fitness/ latest/ activities/search .json ?min_uploaded_at=2014-01-01T10:10:10Z&provider=magellan &access_token=my-access-token
However if I specify the date using the identical format for the field: max_performed_at or min_performed_at it works as expected.  

Remove the ‘Z’ from the timestamp. All timestamps should use the format "<YYYY>-<MM>-<DD>T<HH>:<MM>:<SS>” (no ‘Z’ or “.<SSS>”).

  • There’s a mistake in the Developer API documentation and it shows ".<SSS>” for min_updated_at and max_updated_at, so I just logged an issue to have it corrected.
  • There’s a mistake in the API Explorer and it still shows “<Z>” for all 6 timestamp parameters, so I just logged an issue to have it corrected.

Thank you for pointing these out!

As an additional note while min_performed_at and max_performed_at work as expected returning the correct number of results, the field max_updated_at and min_updated_at return zero results when one field is specified and the other is left blank.

Searching on just 1 or the other works as expected for me. What you are experiencing may be due to the behavior of the updated_at field itself. The default value for activities uploaded after this new field was added on 2013-12-30 is uploaded_at, before then it is "null”. The activities with a value of null do not show up when searching on either min_updated_at or max_updated_at. We left as null for prior activities because we didn’t want to falsely assume the data was never updated and set the value to uploaded_at. Better to leave as null than insert potentially incorrect data.

I just noticed the updated_at field was added to the activity search response, but not the activity get response. I’ve logged an enhancement request to have updated_at added to the activity get response along with a note on the behavior of its default value.

Sorry for the confusion, hopefully the documentation updates will help to clarify for others.

--
Anthony (Tony) Pelosi
Magellan GPS, Fitness Division
Product Development Lead

--
You received this message because you are subscribed to the Google Groups "Magellan Active Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to magellan-active-dev...@googlegroups.com.
To post to this group, send email to magellan-acti...@googlegroups.com.
Visit this group at http://groups.google.com/group/magellan-active-developers.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages