Some clients are legally required to hold a copy of their customers' Personal data. In this case, you can retrieve any of the Data points relative to a Verification from the Passbase API:
The Data points required in the Verification (i.e first name, last name, document number, identity score)
Any metadata relative to the Verification (i.e. user agent, timestamp, user references)
We recommend you request & store as few pieces of information as possible about your users on your side. This decreases your data liability to the extent, that you only have to protect the data you truly need. If you only care that a user has been verified or is over a certain age, then you should store this as a boolean (true
/false
) once Passbase has completed the identity or age verification of that user.
In the previous sections, we worked with the client-side SDKs. We used the publishable API key there. Since we are now working in a server-to-server environment, you need to use the secret API key. Please never share this API key or commit it to a repo, since it gives access to your sensitive user data. If you leak this API key, a potential bad actor could retrieve and expose information about the identities of your users.
Be very careful with the secret API key. Never share it or send it through unencrypted communication methods!
Follow the instructions below to install the latest Passbase server-side library in your backend project.
/*Add @passbase/node npm package to your package.json.Passbase has no dependency but expects node version to be LTS (12.x).*/​// Runnpm install @passbase/node --save​
"""Add Passbase's SDK package to your requirements.txt.The SDK should work on both python 2.7 and 3+"""​pip install passbase_sdk && pip freeze | grep passbase_sdk >> requirements.txt​
// Maven users, add this dependency to your project's POM:​<dependency><groupId>com.passbase</groupId><artifactId>passbase</artifactId><version>0.0.1</version><scope>compile</scope></dependency>​//Gradle users, add this dependency to your project's build.gradle:​compile "com.passbase:passbase:0.0.1"
// Add Passbase to your dependencies​go get github.com/passbase/passbase-go
# Add Passbase's SDK gem to your Gemfile.​gem 'passbase', '~> 0.0.1'
​//To install the bindings via Composer, add the following to `composer.json`:​{"repositories": [{"type": "git","url": "https://github.com/passbase/passbase-php.git"}]}​// Then run composer install​
You can use the sample code below to initialize the server-side libraries and interact with the Passbase API. Please do not forget to use your secret API key in the header. The code below shows an example of how to request data from the Passbase API.
You can find more information about all the different functions/methods of the server-side libraries on their individual Github repository.
const { PassbaseClient, PassbaseConfiguration } = require("@passbase/node");​async function main() {const apiKey = "YOUR_SECRET_API_KEY";​// Configure the SDK with your API Secret access keyconst config = new PassbaseConfiguration({apiKey,});const client = new PassbaseClient(config);​// Get project settingsconst settings = await client.getProjectSettings();console.log(JSON.stringify(settings, null, 4));}​main().catch(err => {console.error(err);process.exit(1);});
import passbasefrom pprint import pprint​# Configure the SDK with your API Secret access keyconfiguration = passbase.Configuration()configuration.api_key["X-API-KEY"] = "YOUR_SECRET_API_YEY"api_client = passbase.ApiClient(configuration)api_instance = passbase.ProjectApi(api_client)​try:# Get project settingsapi_response = api_instance.get_settings()pprint(api_response)​except Exception as e:print("Exception when calling ProjectApi->get_settings: %s\n" % e)​
​import com.passbase.*;import com.passbase.api.ProjectApi;import com.passbase.model.ProjectSettings;import java.util.List;import java.util.Map;​public final class App {public static void main(String[] args) {// Configure the SDK with your API Secret access keyApiClient defaultClient = Configuration.getDefaultApiClient();defaultClient.setApiKey("YOUR_SECRET_API_KEY");ProjectApi apiInstance = new ProjectApi(defaultClient);​try {// Get project settingsProjectSettings settings = apiInstance.getSettings();System.out.println(settings);} catch (ApiException e) {printError(e);}}​private static void printError(ApiException e) {System.err.println("Exception when calling ProjectApi#getSettings");System.err.println("Status code: " + e.getCode());System.err.println("Reason: " + e.getResponseBody());System.err.println("Response headers: " + e.getResponseHeaders());e.printStackTrace();}}
package main​import ("context""fmt"​passbase "github.com/passbase/passbase-go")​func main() {​// Configure the SDK with your API Secret access keyclient := passbase.NewAPIClient(passbase.NewConfiguration())ctx := context.WithValue(context.Background(), passbase.ContextAPIKey, passbase.APIKey{Key: "YOUR_SECRET_API_KEY",})​// Get project settingssettings, _, err := client.ProjectApi.GetSettings(ctx)if err != nil {panic(err)}fmt.Println("Setting for ", settings.Slug, "->", settings)}
require 'passbase'​# Configure the SDK with your API Secret access keyPassbase.configure do |config|config.api_key['X-API-KEY'] = 'YOUR_SECRET_API_KEY'end​api_instance = Passbase::ProjectApi.new​begin# Get project settingsresult = api_instance.get_settingsp resultrescue Passbase::ApiError => eputs "Exception when calling ProjectApi->get_settings: #{e}"end
<?phpuse App\Http\Controllers\Controller;use Passbase\Configuration;use Passbase\api\IdentityApi;use GuzzleHttp\Client;​class APIController extends Controller{public function api_call(){// Configure the SDK with your API Secret access key$config = Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'SECRET-KEY');$apiInstance = new IdentityApi(new Client(),$config);// Unique identity access key received from webhooks$id= "identityAccessKey";try {$result = $apiInstance->getIdentityById($id);print_r($result);} catch (Exception $e) {echo 'Exception when calling IdentityApi->getIdentityById: ', $e->getMessage(), PHP_EOL;}}}?>
​