Generate Passcode
Generate a secure passcode for authenticating with the ART platform.
Endpoint: POST /v1/connect/passcode
Headers:
Content-Type: application/jsonX-Org- Your organization identifierClient-Id- Your client ID from credentialsClient-Secret- Your client secret from credentialsEnvironment- Your environment nameProjectKey- Your project key
Request Body:
{
"username": "your_username",
"first_name": "first_name",
"last_name": "last_name"
}
Response:
{
"status": 200,
"data": {
"passcode": "generated_passcode_token_string",
"username": "your_username"
},
"message": "Passcode generated"
}
Code Examples
- JavaScript
- cURL
// Using fetch API
const generatePasscode = async () => {
const response = await fetch('https://dev.arealtimetech.com/ws/v1/connect/passcode', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Org': 'your_organization',
'Client-Id': 'your_client_id',
'Client-Secret': 'your_client_secret',
'Environment': 'your_environment',
'ProjectKey': 'your_project_key'
},
body: JSON.stringify({
username: "your_username",
first_name: "first_name",
last_name: "last_name"
})
});
const data = await response.json();
console.log('Passcode:', data.data.passcode);
return data.data.passcode;
};
// Call the function
const passcode = await generatePasscode();
curl -X POST "https://dev.arealtimetech.com/ws/v1/connect/passcode" \
-H "Content-Type: application/json" \
-H "X-Org: your_organization" \
-H "Client-Id: your_client_id" \
-H "Client-Secret: your_client_secret" \
-H "Environment: your_environment" \
-H "ProjectKey: your_project_key" \
-d '{
"username": "your_username",
"first_name": "first_name",
"last_name": "last_name"
}'