Get a Token - Onboarding
To start the SDK, whatever is the platform, you will need a token.
It will be delivered by the ShareID API service and will be available for one and only one onboarding process.
POST {API_URL}/flow/onboarding/auth/business
{
"business_hash": "",
"api_key": "",
"callback": "",
"callback_with_document_capture": false,
"customer_data": {},
"advanced_verification": false,
"methods": [],
"session_duration": 600,
"restricted_business_scopes": null
}
You'll note that ShareID API is always waiting for your parameters as JSON using the http header:
Here's the description of the json input document:
Parameter | Mandatory | Type / default | Note |
---|---|---|---|
business_hash | yes | string | This is a string provided by your contact @ShareID |
api_key* | yes | string | This is a string provided by your contact @ShareID |
customer_data | yes | object / {} | This data is for your own usage. You can set here any data related to your users or your CRM for example. |
methods | no | array of string | Your business may usedocand/orfacemethods to onboard a user. |
callback | no | url / null | This url will be called with the onboarding result (please checkherealso) |
callback_with_document_capture | no | boolean / false | Setting this parameter to true will give you access to the the images crops in the onboarding result (please checkherealso) |
advanced_verification | no | boolean / false | By default, ShareID uses one challenge. To require more, set advanced_verification to true.Note that this will also extend the onboarding andanalysis time. |
restricted_business_scopes | no | list of business scopes / null | Your business can onboard users with documents issued from a list of countries. You can, using this parameter limit the pre-defined scope so you're users will only see a limited list of countries/documents in the SDK |
session_duration | on | int [300, 3600] | You can here customize the max session duration for you're users. It is expressed in seconds. By default it is set to 600 (10 min). |
Warning
Your credentials are your responsibility. You must never enter them in hard copy in your application.
restricted_business_scopes
A business scope is an object defined as below:
{
"country_code": an ISO 3166-1 alpha-2 lowercase (eg: "en", "fr" ...),
"doc_types": a list of document types from "id_card", "passport", "driver_permit", "residency_permit"
}
Example
POST {API_URL}/flow/onboarding/auth_business
{
"business_hash": "2915ac99",
"api_key": "fl-00ea000defabc",
"callback": "https://mycompany.com/api/shareid_result.php",
"callback_with_document_capture": false,
"customer_data": {
"internal_id": "2c2-2c8a-4a19"
},
"methods": ["face"],
"restricted_business_scopes": [
{
"country_code": "fr",
"doc_types": ["id_card", "passport"]
},
{
"country_code": "es",
"doc_types": ["passport"]
}
]
}
Response
In response, you'll also get a json document:
The applicant_id
uniquely identifies the user in our system. You should keep track of this value in order to fetch the result later. If you're using a callback, the applicant_id
will also be send to your server (check here result on the callback).