$ curl -X PUT https://cloud.logintc.com/api/domains/9120580e94f134cb7c9f27cd1e43dbc82980e152/users/8c184f495a5b7b6e9ed732f2ce3c67e310806f38/token \
-H 'Authorization: LoginTC key="YOUR_API_KEY"' \
-H 'Content-Length: 0'
{
"state" : "pending",
"code" : "d2mfr24l8r"
}
<?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);
// Domain id
$domain_id = '9120580e94f134cb7c9f27cd1e43dbc82980e152';
// User id
$user_id = '8c184f495a5b7b6e9ed732f2ce3c67e310806f38';
// Helper function to create user domain token
$token = $logintc->createUserToken($domain_id, $user_id);
echo $token->getState();
# 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)
# Domain id
domain_id = '9120580e94f134cb7c9f27cd1e43dbc82980e152'
# User id
user_id = '8c184f495a5b7b6e9ed732f2ce3c67e310806f38'
# Helper function to create user domain token
token = client.create_user_token(domain_id, user_id)
print token['state']
// 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.Token;
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);
// Domain id
String domainId = "9120580e94f134cb7c9f27cd1e43dbc82980e152";
// User id
String userId = "8c184f495a5b7b6e9ed732f2ce3c67e310806f38";
// Helper function to create user domain token
Token token = logintc.createUserToken(domainId, userId);
System.out.println(token.getState());
}
}