Authorisation URL
This is where you’ll send your users to begin the authorisation process. This is not an API endpoint.Example
A detailed view of the auth url
Example
A detailed view of the auth url
Query parameters
Success
Successfully authenticated and verified users who authorise your application will be redirected to your app in their browser, at the redirect URI you provide to us. If you have registered more than one redirect URI, we will use the one you included in the URL above. When a user has authorised your app, we will give you an authorisation grant code in thecode query parameter on the redirect URI.
A user who chooses not to authorise your app by clicking “Cancel” will be sent back to the redirect URI you provided without the authorisation grant code. This is not an error, and doesn’t have any relation to their verification status.
Below are some examples of redirect URIs you might send to us, and where we will send the user as a result.
- Default (HTTPS)
- Alternative Scheme
- Custom Query Parameters
Errors
These are shown on our service but it may be helpful to know their causes in case users report them to you. They are typically caused by an issue with your implementation, but contact your account manager or support if you continue to have issues.The redirect uri included is not valid
Redirect URIs must be registered with us and are matched strictly on scheme, authority and path. Check that theredirect_uri parameter you are including is correct.
Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method
Ensure that theclient_id parameter you are including is correct.
The authorization server does not support this response type
Theresponse_type parameter must be code.
API Endpoints
These endpoints are accessed athttps://accounts.studentbeans.com - note the subdomain, which is different from the authorisation URL above.
POST /oauth/token
Exchange an authorisation grant code for an API access token.
Example
Example
Success
On success, you will receive a JSON object containing an access token, refresh token and metadata.Error
In the case of an error, we will return an appropriate HTTP status code and a JSON-formatted body detailing the problem.400 Bad Request
invalid_grant
code) you’ve sent us is invalid, has been used already or has expired. If you have different client IDs across several clients, the code may have been generated for a different client ID.
Ensure that the redirect URI exactly matches the one you included in the redirect_uri parameter when you linked the user to /oauth/authorize. It must match exactly, including any custom query parameters this time.
invalid_request
code parameter, ensure that users who arrive at your redirect URI without the code parameter are handled correctly - this can happen when they decline to authorise your app.
unsupported_grant_type
grant_type query parameter in your request is present and has the value authorization_code. We do not currently support other grant types.
401 Unauthorized
GET /api/v3/me.json
Get an authorised user’s verification information.
Example
Example
- Query Parameter
Success
- Verified (one supergroup)
- Verified (several supergroups)
- Not Verified
The user has an active verification in one group.
Response field reference
Error
In case of error, our response will include an appropriate HTTP status code.400 Bad Request
This response has no body. It occurs when your request to us is malformed. Check that your HTTP client is configured correctly and is sending required HTTP request headers, likeHost.
401 Unauthorized
This response may have a body:Authorization header or the access_token query parameter, and that the access token is one you got from the /oauth/token API endpoint above. You cannot use the authorisation grant code for this endpoint.
403 Forbidden
This response has no body. This error may occur if your request has noUser-Agent header.
404 Not Found
This response may have a body:Consumer Supergroups reference
Below is a reference of consumer supergroups and the closed consumer groups they contain, with the string value that will appear in thesupergroup key in the API response.