Exchanges a set of client credentials and a user's sign-in details for an access token. Every other endpoint in this API expects the result in an Authorization: Bearer <access_token> header, so this is the first call an integration makes.
You need a client_id and client_secret before you can call it. The client id is the id of one of your personal access clients - see the listing endpoint below. Rosterfy issues the matching secret; no endpoint returns it.
The token is issued for the user whose username and password you send, and it carries exactly that user's access. Use a dedicated integration user rather than a person's own login, so the integration keeps working when people come and go and so its activity is distinguishable in the audit trail.
expires_in is the lifetime in seconds - 2592000, or 30 days. The refresh_token returned alongside it lasts longer than the access token and can be exchanged for a new one by calling this endpoint again with grant_type set to refresh_token, sending refresh_token in place of username and password. Refresh before the access token expires rather than after; once it has lapsed there is nothing to refresh and you are back to a full credential exchange.
The body may be sent as JSON or as application/x-www-form-urlencoded. Both are accepted and both return JSON.
Treat the access token as a credential in its own right. It is a bearer token: anything holding it has the user's access for as long as it lives, so store it the way you would store the password you exchanged for it, and never put it in a URL or a log.
The exchange being performed. Send password for the initial exchange, or refresh_token to renew an existing token.
The email address of the user the token is issued for. Required when grant_type is password.
The refresh token from an earlier exchange. Required when grant_type is refresh_token, and ignored otherwise.
- Mock serverhttps://developer.rosterfy.com/_mock/api-docs/openapi/api/v2/oauth/token
- Your Rosterfy accounthttps://example.rosterfy.com/api/v2/oauth/token
- Initial exchange
- Renewing a token
curl -i -X POST \
https://developer.rosterfy.com/_mock/api-docs/openapi/api/v2/oauth/token \
-H 'Content-Type: application/json' \
-d '{
"grant_type": "password",
"client_id": 1234,
"client_secret": "{YOUR_CLIENT_SECRET}",
"username": "integration@example.com",
"password": "{YOUR_PASSWORD}",
"scope": "*"
}'A new access token.
{ "token_type": "Bearer", "expires_in": 2592000, "access_token": "{ACCESS_TOKEN}", "refresh_token": "{REFRESH_TOKEN}" }