Skip to content

Instantly share code, notes, and snippets.

@mosufy
mosufy / app-server-block-nginx-lemp-ssl
Created January 20, 2015 05:43
Application Server Block for NGINX LEMP Stack Configuration with SSL
server {
listen 80;
server_name domain.dev;
# force all requests to connec via HTTPS
return 301 https://domain.dev$request_uri;
}
server {
listen 443 ssl;
@mosufy
mosufy / vbc-api-sample-request-format.json
Last active August 29, 2015 14:16
VBC API Sample Request Format
$ curl -G https://api.verifiedbycam.com/v2/requests \
-H "X-App-Key: c9cf97d8c394a861" \
-H "X-Secret-Key: 779de173efee7e3b2e816c164004dd77d6ac1967dc6d0ca128cd5cd7afd77503"
@mosufy
mosufy / vbc-api-sample-response-format.json
Created March 10, 2015 03:01
VBC API Sample Response Format
{
"link": "https://api.verifiedbycam.com/delegate?token=13e26bbfc2847f786c7971c",
"token": "13e26bbfc2847f786c7971c"
}
@mosufy
mosufy / vbc-api-sample-error-response.json
Last active August 29, 2015 14:16
VBC API Sample Error Response
{
"message": "An unknown error has occured.",
"error_id": "13e09fbdbafb1bbaf619eea53b4f2e97284cf7c0e2510933ddd2ec81a8118eb3"
}
@mosufy
mosufy / vbc-api-post-request-example-1.json
Last active August 29, 2015 14:16
VBC API Request a token for web based video verification
$ curl -X POST https://api.verifiedbycam.com/v2/request \
-H "X-App-Key: c9cf97d8c394a861" \
-H "X-Secret-Key: 779de173efee7e3b2e816c164004dd77d6ac1967dc6d0ca128cd5cd7afd77503" \
-H "Content-Type: application/json" \
-d '{
"uid": 4323499,
"callback": "https://domain.com/request-received",
"caption": "Hi! My name is Finn of Adventure Time!",
"data": {
"email": "[email protected]",
@mosufy
mosufy / vbc-api-post-request-example-1-response.json
Created March 10, 2015 03:11
VBC API Request a token for web based video verification response
{
"link": "https://api.verifiedbycam.com/delegate?token=13e26bbfc2847f786c7971c",
"token": "13e26bbfc2847f786c7971c"
}
@mosufy
mosufy / vbc-api-post-request-example-2.json
Created March 10, 2015 03:14
VBC API Request a token for mobile app based video verification
$ curl -X POST https://api.verifiedbycam.com/v2/request \
-H "X-App-Key: c9cf97d8c394a861" \
-H "X-Secret-Key: 779de173efee7e3b2e816c164004dd77d6ac1967dc6d0ca128cd5cd7afd77503" \
-H "Content-Type: application/json" \
-d "pin=true" \
-d '{
"uid": 4323499,
"callback": "https://domain.com/request-received",
"caption": "Hi! My name is Finn of Adventure Time!",
"data": {
@mosufy
mosufy / vbc-api-post-request-example-2-response.json
Last active August 29, 2015 14:16
VBC API Request a token for mobile app based video verification response
{
"link": "https://api.verifiedbycam.com/delegate?token=13e26bbfc2847f786c7971c",
"pin": 483992
}
@mosufy
mosufy / vbc-api-video-submission-callback.json
Last active August 29, 2015 14:16
VBC API Video submission by user callback sample
$ curl -X POST https://yourdomain.com/callback \
-H "X-Vbc-Request-Signature: 7284cf7c9eea530933ddd2ec81a8118ebb4f213e0e2513baf6109fbdbafb1be9" \
-H "X-Vbc-APP-Id: 54ee934f71468075228b4ac2" \
-H "X-Vbc-Request-Id: 54eec765714680226d8b4968" \
-H "X-Vbc-Nonce: 3jd8sf" \
-d '{
"type": "UPLOAD_STATUS",
"status": "PROCESSED",
"request": {
"uid": "123456",
@mosufy
mosufy / vbc-api-callback-signature-verification-php-example.php
Last active August 29, 2015 14:16
VBC API Callback Signature Verification PHP Example
<?php
$http_date = $_SERVER['HTTP_Date'];
$http_nonce = $_SERVER['HTTP_X_VBC_NONCE'];
$secret_key = '16c164004dd77d6ac1967dc6d0ca128cd5cd7afd77503779de173efee7e3b2e8'; // Your API Secret Key
$http_signature = $_SERVER['HTTP_X_VBC_REQUEST_SIGNATURE'];
$signature_construct = hash_hmac("sha256", $http_date . $http_nonce, $secret_key);
if ($http_signature != $signature_construct) {