v1
latestOpenAPI 3.0.02026-07-26432882.9 KBAdditional Endpoints
client token
If a client-facing web page is making requests directly to our service, it will need an access token. To avoid exposing your main account's token to the public, we recommend using temporary client tokens. The process looks like this:
- When generating page content, your server asks the Regrid API for a temporary client token limited to typeahead calls (details below). You can create as many of these as desired, for free.
- The javascript autocomplete widget uses this token to call Typeahead API
- If it's invalid or expired, the request will return an HTTP code 400. You may wish to refresh the page to regenerate the client token
get/client_token/typeahead
Query parameters
tokenstring required
The main (secret) access token on your account.
expnumber
(optional): Expiration time in seconds. For example, exp=14400 would generate a 4-hour token. The default is 24 hours (86400 seconds).
Response
sucessful response
Example response
{
"token": "YOUR_CLIENT_TOKEN",
"expires_at": 1714492176
}