Skip to main content

Generate Passcode

Generate a secure passcode for authenticating with the ART platform.

Endpoint: POST /v1/connect/passcode

Headers:

  • Content-Type: application/json
  • X-Org - Your organization identifier
  • Client-Id - Your client ID from credentials
  • Client-Secret - Your client secret from credentials
  • Environment - Your environment name
  • ProjectKey - 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

// 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();