The WeStudents Student Verification SDK allows to verify student identity through four different methods:
- Login with WeStudents
- Login with electronic register (ARGO, AXIOS, NUVOLA, CLASSEVIVA, MASTERCOM)
- Upload of identity documents (async)
- School email verification (async)
The following schema describe the process for student verification:
⚠️ WARNING: For asynchronous processes (3 and 4) the final result of the request will be sent to client through the webhook endpoint inserted in enrollment phase.
You can include the library as a regular script tag on your page:
<script src="https://storage.googleapis.com/westudents-public/scripts/verify-sdk.js"></script>
StudentVerificationSDK.init({
apiKey: 'YOUR-API-KEY',
userExternalId: 'USER-ID',
onCompleted: ({ userId, verified, status }) => {
// handle verification response here
},
options: {
// optional configs
wsLoginEnabled: true,
electronicRegisterEnabled: false
}
})
Your personal api key. If you do not yet have one, visit this page.
You can pass an ID to link verification requests to the user. If you do not pass an ID, it will be automatically generated.
A callback function triggered after verification flow ends.
Params:
userId: string
: The user identifier specified or autogenerated.verified: boolean
: Boolean value for verification status.status: string
: Status of the latest request done. Could bePENDING
,REJECTED
orVERIFIED
.
Possible values:
METHOD | verified | status |
---|---|---|
false |
PENDING , REJECTED |
|
Documents | false |
PENDING , REJECTED |
Electronic Register | true , false |
VERIFIED , REJECTED |
Login with WS | true , false |
VERIFIED , REJECTED |
Configuration options:
wsLoginEnabled: boolean
: Enable verification through the login with WeStudents app. Default:true
.electronicRegisterEnabled: boolean
: Enable verification through electronic registers APIs. Default:true
.
Include the library as a regular script tag on your page:
<html>
<head>
+ <script src="https://storage.googleapis.com/westudents-public/scripts/verify-sdk.js"></script>
</head>
<body>
...
</body>
</html>
<html>
<head>
<script src="https://storage.googleapis.com/westudents-public/scripts/verify-sdk.js"></script>
</head>
<body>
+ <div>
+ <div>
+ <h2>VERIFY STUDENT IDENTITY</h2>
+ <div>
+ <p id="user">User ID: </p>
+ <p id="result"></p>
+ </div>
+ </div>
+ </div>
</body>
</html>
You can now initialize the SDK, with the apiKey
(click here to require one) and an userExternalId
. You can also disable **Login with WeStudents app and Login with electronic register methods.
<html>
<head>
<script src="https://storage.googleapis.com/westudents-public/scripts/verify-sdk.js"></script>
</head>
<body>
+ <script>
+ function verify() {
+ StudentVerificationSDK.init({
+ apiKey: 'YOUR-API-KEY',
+ userExternalId: 'USER-ID',
+ options: {
+ // optional configs
+ wsLoginEnabled: true,
+ electronicRegisterEnabled: false
+ }
+ })
+ }
+ </script>
<div>
<div>
<h2>VERIFY STUDENT IDENTITY</h2>
<div>
<p id="user">User ID: </p>
<p id="result"></p>
</div>
</div>
+ <button onClick="verify()">Verify</button>
</div>
</body>
</html>
To handle verification response, you have to define onCompleted
callback function, it will be execute after verification flow ends and returns:
userId
: The user identifier specified or autogenerated.verified
: Boolean value for verification status.status
: Status of the latest request done.
<html>
<head>
<script src="https://storage.googleapis.com/westudents-public/scripts/verify-sdk.js"></script>
</head>
<body>
<script>
function verify() {
StudentVerificationSDK.init({
apiKey: 'YOUR-API-KEY',
userExternalId: 'USER-ID',
options: {
// optional configs
wsLoginEnabled: true,
electronicRegisterEnabled: false
}
+ onCompleted: ({ userId, verified, status }) => {
+ document.getElementById('user').innerHTML = `User ID: ${userId}`
+ if (verified) {
+ document.getElementById('result').style.color = "green"
+ document.getElementById('result').innerHTML = `VERIFICATO CON SUCCESSO`
+ } else {
+ if (status == 'PENDING') {
+ document.getElementById('result').style.color = "#eb9c00"
+ document.getElementById('result').innerHTML = `VERIFICA IN CORSO`
+ } else if (status == 'REJECTED') {
+ document.getElementById('result').style.color = "red"
+ document.getElementById('result').innerHTML = `VERIFICA FALLITA`
+ }
+ }
+ }
})
}
</script>
<div>
<div>
<h2>VERIFY STUDENT IDENTITY</h2>
<div>
<p id="user">User ID: </p>
<p id="result"></p>
</div>
</div>
<button onClick="verify()">Verify</button>
</div>
</body>
</html>
Westudents.it |