•   about 6 years ago

Start and Duration parameters

Hi,

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:
eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiIyNTI0LmYwODRlNTA2LTI1NTEtNGZjYy05N2VjLTU5N2Q5NDliNzhjZSIsImF1ZCI6ImNvbW1lcmNlIiwicHJuIjoidmVybm9uQGRhdGFjdXN0b2RpYW4uY29tIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbInVzZXIiXX19.CrkK3RHkfhOl-uJSm956gXv_XQ6Y0Ul51vCihF8TgEeOUqZhqZcausPe4d-4DW3TMqjAMprMIykGZnRxSHGtca8XJlGH7MxjmlbzWEypbyo_BFlmq96tKf5ekPPsJUlQvDDYQTXRiUNs6hSNPppFclQfyQMYL9Sw2igrcbHgjgOHstHqErhvcGgCcdQIcX5_QdLqaYE16KCGPc720OTBbo6E-MLVonQLEqo6oJEkEVxggkXbGsSzvOT9vPZo6xVGdSc4u1zSKOkKTxsPReXFgV03ghYuySOVu5ONe7fzLiZ-T-cNYX2_AVhxSrytBHzu5solGfQ_fE1KTmtYCmxrbQ

https://greenbutton.affsys.com/ldc/api/v1/UsagePoint?duration=2592000&start=1385856000

is the call we are using.

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

Thanks so much.

  • 5 comments

  •   •   about 6 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?

  •   •   about 6 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?

  •   •   about 6 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.

    -Jade

  •   •   about 6 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.

  •   •   about 6 years ago

    Thanks everyone

Comments are closed.