Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool needed: Java code that gets the daily token needed to query the CityIQ API #3

Open
mwesterfield opened this issue Feb 11, 2020 · 1 comment

Comments

@mwesterfield
Copy link
Member

If we want to get the streetlight data without using Postman (and we do!), we need code that will do the authentication and store the daily token. Maybe we should save the token as a file in this repo, and if it's been more than 24 hours since the file was last modified, this process would be run again automatically? So I guess the code would need to do these two things:

  1. Check the age of the token file, if > 24hrs, get new token
  2. Use the token file to generate a header that will be used for GET requests
@swingley
Copy link
Contributor

It's probably easiest get a token as the first step of getting any data. That way we don't need to manage refreshing a token when it expires. This is the pattern that the example code from CityIQ follows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants