PHP code example of verifymycontent / video-moderation
1. Go to this page and download the library: Download verifymycontent/video-moderation library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
verifymycontent / video-moderation example snippets
ration = new VerifyMyContent\VideoModeration\Moderation(getenv('VMC_API_KEY'), getenv('VMC_API_SECRET'));
//$moderation->useSandbox();
$response = $moderation->start(new \VerifyMyContent\SDK\ContentModeration\Entity\Requests\CreateStaticContentModerationRequest([
"content" => [
"type" => "video",
"external_id" => "YOUR-VIDEO-ID",
"url" => "https://example.com/video.mp4",
"title" => "Uploaded video title",
"description" => "Uploaded video description",
],
"webhook" => "https://example.com/webhook",
"customer" => [
"id" => "YOUR-CUSTOMER-UNIQUE-ID",
"email" => "[email protected]",
"phone" => "+4412345678"
]
]));
// save $response->id if you want to call the moderation status endpoint later
// redirect uploader to check identity
header("Location: {$response->redirect_url}");
ration = new VerifyMyContent\VideoModeration\Moderation(getenv('VMC_API_KEY'), getenv('VMC_API_SECRET'));
//$moderation->useSandbox();
$response = $moderation->get($moderationID);
// Printing current status
echo "Status: {$response->status}";
et request body
$body = file_get_contents('php://input');
// get headers
$headers = getallheaders();
// instantiate VerifyMyContent helper class
$hmac = new VerifyMyContent\Commons\Security\HMAC(getenv('VMC_API_KEY'), getenv('VMC_API_SECRET'));
// validate hmac Authorization
if(!array_key_exists('Authorization', $headers) || !$hmac->validate($headers['Authorization'], $body)) {
die("This request did not come from VerifyMyContent");
}
// you can do your logic now, the webhook was called from VerifyMyContent.
var_dump($body);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.