Token
For every Prefetch Pageviews API call to get the count or increment it, you need to pass a JWT token. The token endpoint is what provides the JWT token.
About token
Point to note about token is its validity and why it matters.
- A token is valid for 15 minutes
- A valid token can be used to increment page count for any page
- A valid token can update a give page only once, subsequest request would succeed but wont change the count
- A token fetch request within the same time frame would return the same token
Get Token
Request
GET
/v1/tokencurl -X GET "https://prefetch.io/api/v1/token"
Response
{
"token": "your-generated-token-string"
}