$ curl -X POST https://cloud.logintc.com/api/users/8c184f495a5b7b6e9ed732f2ce3c67e310806f38/bypasscodes \
-d '{"usesAllowed" : "5", "expirationTime" : "43200"}' \
-H 'Authorization: LoginTC key="YOUR_API_KEY"'
{
"id":"8eb5d62d725b55a611b966fd5fc0fb6b5e93e476",
"code":"478321641",
"usesAllowed":5,
"usesRemaining":5,
"dtExpiry":"2015-08-14T11:10:00-0400",
"user":"8c184f495a5b7b6e9ed732f2ce3c67e310806f38"
}
<?php
// Get the library from github.com/logintc/logintc-php
require_once('logintc-php/LoginTC.php');
// Your API Key from cloud.logintc.com/panel/settings
$api_key = 'YOUR_API_KEY';
$logintc = new LoginTC($api_key);
// Bypass Code details
$user_id = '8c184f495a5b7b6e9ed732f2ce3c67e310806f38';
$uses_allowed = 5;
$expiration_time = 43200;
// Helper function to create bypass code
$bypass_code = $logintc->createBypassCode($user_id, $uses_allowed, $expiration_time);
echo $bypass_code->getId();
# Get the library from github.com/logintc/logintc-python
import logintc
# Your API Key from cloud.logintc.com/panel/settings
api_key = 'YOUR_API_KEY'
client = logintc.LoginTC(api_key)
# User details
user_id = '8c184f495a5b7b6e9ed732f2ce3c67e310806f38'
uses_allowed = 5
expiration_time = 43200
# Helper function to create bypass code
bypass_code = client.create_bypass_code(user_id, uses_allowed, expiration_time)
print bypass_code['id']
// Get the library from github.com/logintc/logintc-java
import com.cyphercor.logintc.LoginTC;
import com.cyphercor.logintc.LoginTC.LoginTCException;
import com.cyphercor.logintc.resource.BypassCode;
public class Example {
// Your API Key from cloud.logintc.com/panel/settings
public static final String API_KEY = "YOUR_API_KEY";
public static void main(String[] args) throws LoginTCException {
LoginTC logintc = new LoginTC(API_KEY);
// Bypass Code details
String user_id = "8c184f495a5b7b6e9ed732f2ce3c67e310806f38";
Integer uses_allowed = 5;
Integer expiration_time = 43200;
// Helper function to create bypass code
BypassCode bypass_code = logintc.createBypassCode(user_id, uses_allowed, expiration_time);
System.out.println(bypass_code.getId());
}
}