We'll be reaching out via the ArcGIS REST API to retrieve drive-time polygons as seen here:
Since these calls will cost ESRI creidts, I'd like to display our credit balance before we make the call so that we don't exceed our credits/know when we're low.
Is there a quick and dirty REST API url that we can hit to get our credit balance so I can show it to the user and let them decide if they want to execute?
You *can* get the balance using the following form, but the lifespan of the token may be a problem:
1. Log into arcgisonline
2. Open your browser's development console, then refresh the page and watch your network tab.
3. Find the REST call tied to your credit lookup. It should take the form:
4. Reuse this call where you intend to do the actual credit check, and use the "availableCredits" key in the JSON response.
The tokens seem to expire quickly, so you may need to find a way to generate a longer lasting token.