Skip to main content

Identity Verification

SDK

We provide a PHP SDK containing an example integration to make it easier and faster to get ready to verify your customers:

VerifyMyContent Identity-Verification PHP SDK

Postman Workspace

We've created a Postman workspace specifically for our API, which contains example API calls that you can use to test and familiarise yourself with our API.

The workspace includes example API calls for each of our API endpoints, along with detailed descriptions of the request parameters and headers being used.

You can generate most of the client code to call our APIs using the Postman client code generator. With this feature, developers can select a range of programming languages, and generate the corresponding code with a few clicks.

Please note that while both the example API calls and the generated code can be a helpful starting point, it's important to thoroughly test your own API calls before deploying them in production. If you encounter any issues while using the example API calls, or if you have any questions about our API, please don't hesitate to reach out to our support team.

API Domain

Our API is designed to be used in two environments: a sandbox environment and a production environment.

The sandbox environment is intended for testing and development purposes, while the production environment is used for live data and real-world use cases.

To ensure the security and integrity of our API, we use separate API keys for each environment. This means that you will need to obtain different API keys for the sandbox and production environments, and should not use the same key for both.

DomainEnvironment
https://oauth.verifymycontent.comproduction
https://oauth.sandbox.verifymycontent.comsandbox

Generating the HMAC header

To improve the security of the communication between your implementation and the VerifyMyContent API, we require you to generate a unique hexadecimal encoded SHA256 HMAC hash for each request, based on the input parameters.

The process of generating it depends on the language of your implementation.

If you use our SDK, the HMAC step will be abstracted,
and you don't need to do anything related to it.
Copy

Copied!

<?php

hash_hmac('sha256', $input, 'API_SECRET');
Copy

Copied!

import { HmacSHA256 } from 'crypto-js';

HmacSHA256(JSON.stringify(input), 'API_SECRET').toString()
Copy

Copied!

Integration steps

Create Identity Verification

To create an identity verification, you'll need to send us the url the user will be redirected to after they finish the verification, some data for them so we can trigger reminders and notifications during the process, and a webhook to notify you when the identity verification status changes.

Important: Please generate a universally unique identifier (UUID v4) for each customer on your site. You should then use this same customer ID every time you call one of our APIs on behalf of that customer. This UUID should never change. For example, if the customer's username on your site changes, their UUID shouldn't.

Authorization Header

Generate HMAC with: Request Body
Authorization: hmac YOUR-API-KEY:GENERATED-HMAC

Request parameters

customer required

Customer information

id required

Customer's unique ID

email required

Customer's email address

redirect_uri optional

The URL where we will redirect the customer after they finish the identity verification process

webhook required

The URL where we will post status updates on the moderation.

Response parameters

id

Unique identifier generated by the VerifyMyContent API.

customer

Customer information

id

Customer's unique ID

email

Customer's email address

redirect_uri

The URL you should redirect the user to start the verification process.

webhook

The URL where we will post status updates on the moderation.

API Call
POST /api/v1/identity-verification HTTP/1.1
Content-Type: application/json
Authorization: hmac YOUR-API-KEY:GENERATE-HMAC-WITH-REQUEST-BODY

{
    "customer": {
        "id": "YOUR-USER-ID",
        "email": "person@example.com"
    },
    "redirect_uri": "https://verifymy.io",
    "webhook": "https://example.com/webhook"
}
Copy

Copied!

curl -d '{"customer": {"id": "YOUR-USER-ID", "email": "person@example.com"}, "redirect_uri": "https://verifymy.io", "webhook": "https://example.com/webhook"}' \
-H "Content-Type: application/json" \
-H "Authorization: hmac YOUR-API-KEY:GENERATE-HMAC-WITH-REQUEST-BODY" \
-X POST https://oauth.sandbox.verifymycontent.com/api/v1/identity-verification
Copy

Copied!

<?php
require(__DIR__ . "/vendor/autoload.php");

use \VerifyMyContent\IdentityCheck\VMC;

$vmc = new VMC(getenv('VMC_API_KEY'), getenv('VMC_API_SECRET'));
//$vmc->useSandbox();

$response = $vmc->createIdentityVerification([
    "customer" => [
        "id" => "YOUR-CUSTOMER-UNIQUE-ID",
        "email" => "person@example.com",
        "phone" => "+4412345678"
    ],
    "redirect_uri" => "https://example.com/callback",
    "webhook" => "https://example.com/webhook",
]);
Copy

Copied!

Response 201: (application/json)
{
  "id": "ABC-123-5678-ABC",
  "customer": {
    "id": "YOUR-USER-ID",
    "email": "person@example.com"
  },
  "redirect_uri": "https://.../v/ABC-123-5678-ABC",
  "webhook": "https://example.com/webhook"
}
Copy

Copied!

Get Identity Verification

Authorization Header

Generate HMAC with: Request URI
Authorization: hmac YOUR-API-KEY:GENERATED-HMAC

Response parameters

id

Unique identifier generated by the VerifyMyContent API.

customer

Customer information

id

Customer's unique ID

email

Customer's email address

redirect_uri

The URL you should redirect the user to start the verification process.

webhook

The URL where we will post status updates on the moderation.

status

It represents the current status of the identity verification flow. It can be one of the following:

StatusDescription
pendingThe verification is pending and the user has not yet started the verification process.
startedThe verification has started and the user has been redirected to the verification page.
expiredThe verification has expired (5 days after creation) and the user has not completed the verification process.
failedThe verification has failed. The user attempted multiple times but didn't succeed.
approvedThe verification has been approved. The user has successfully completed the verification process.
API Call
GET /api/v1/identity-verification/{ID} HTTP/1.1
Content-Type: application/json
Authorization: hmac YOUR-API-KEY:GENERATE-HMAC-WITH-REQUEST-URI
Copy

Copied!

curl -H "Authorization: hmac YOUR-API-KEY:GENERATE-HMAC-WITH-REQUEST-URI" \
https://oauth.sandbox.verifymycontent.com/api/v1/identity-verification/{ID}
Copy

Copied!

<?php
require(__DIR__ . "/vendor/autoload.php");

use \VerifyMyContent\IdentityCheck\VMC;

$vmc = new VMC(getenv('VMC_API_KEY'), getenv('VMC_API_SECRET'));
//$vmc->useSandbox();

$response = $vmc->getIdentityVerification("ID");
Copy

Copied!

Response 200: (application/json)
{
  "id": "ABC-123-5678-ABC",
  "customer": {
    "id": "YOUR-USER-ID",
    "email": "person@example.com"
  },
  "redirect_uri": "https://.../v/ABC-123-5678-ABC",
  "webhook": "https://example.com/webhook",
  "status": "approved"
}
Copy

Copied!

Sample Webhook Notification

When the identity verification status changes, we will send a webhook notification to the url you provided when you created the identity verification.

Authorization Header

Generate HMAC with: Request Body
Authorization: hmac YOUR-API-KEY:GENERATED-HMAC

Request parameters

id

Unique identifier generated by the VerifyMyContent API.

customer_id

Customer identifier you provided while creating the identity verification.

status

It represents the current status of the identity verification flow. It can be one of the following:

StatusDescription
pendingThe verification is pending and the user has not yet started the verification process.
startedThe verification has started and the user has been redirected to the verification page.
failedThe verification has failed. The user attempted multiple times but didn't succeed.
approvedThe verification has been approved. The user has successfully completed the verification process.
Webhook Call
POST /your-path HTTP/1.1
Host: https://your-domain.com
Content-Type: application/json
Authorization: hmac YOUR-API-KEY:GENERATE-HMAC-WITH-REQUEST-BODY

{
    "id": "ABC-123-5678-ABC",
    "customer_id": "YOUR-USER-ID",
    "status": "approved"
}
Copy

Copied!

curl -d '{"id": "ABC-123-5678-ABC", "customer_id": "YOUR-USER-ID", "status": "approved"}' \
-H "Content-Type: application/json" \
-H "Authorization: hmac YOUR-API-KEY:GENERATE-HMAC-WITH-REQUEST-BODY" \
-X POST https://your-domain.com/your-path
Copy

Copied!

Response 2xx