•   over 8 years ago

Start and Duration parameters


We're very close, just one last problem!!! We are using the GET to get the EUI data, and the start & duration parameters are giving us some problem.

We authorize the user up to Jan 31 2014, and say 730 days of authorization on the Data Custodian. Then we are requesting the following (which work):

duration=2592000 (31 days)
start=1385856000 (Dec 1 2013)

If we try accepting for > 1 month it stops working. We also cannot seem to request for the 2014 year.

I know there is probably something in the parameter type request we are doing, but is there any other information we need to know? How do we request everyday from todays data for the past 2 years?

Here is the access token:


is the call we are using.

If you could clarify that would be absolutely life saving!!!!

Thanks so much.


  •   •   over 8 years ago

    Can you send exact parameters that DON'T work for you? What you are trying to get? Dec 1 2013 for more than 1 month? That should work but if your interval end time is more than current time you will get an error. Did that help?

  •   •   over 8 years ago

    Thanks for the response!

    Ah, I see, that makes sense!

    What assumptions (if any) are we allowed to make about what the challenge post judges will do? I just set the authorization token to expire Dec 31 2014, and an authorization period for 730 days. Then make my requests based on that.

    Is this valid?

    Additionally, I have tried the different users available to us and they all seem to be working. Are any users not giving back data or behaving strangely?

  •   •   over 8 years ago

    Hi azizsye1,

    The judges will enter 730 days for the authorization period.

    Additionally, access tokens do not expire in this test bed.

    Normally, in a real deployment, you would use the refresh token generated on authorization to renew your token periodically. OAuth2 libraries generally take care of this for you.

    I hope that clears some things up.


  •   •   over 8 years ago

    I just want to clarify. There are two different things:
    1. Authorization token period/expiry date
    2. Authorization data period
    In your example token period is Dec 31 2014, that means you can send requests to data custodian and ask for the data till Dec 31 2014.
    But that does not indicate what data period you can ask. Authorization data period is indicated by history length from current time (I think floored to the hour). I check if end time of my interval is more than current time I decrease duration.
    Keep in mind that it can be tricky in months when DST changes.
    It took me a full day to go through all possible conditions :-)
    Hope that helps.

  •   •   over 8 years ago

    Thanks everyone

Comments are closed.