Skip to main content

Create New Connection

Step 2 of the API flow. Establish a new connection to the ART platform using your JWT token and receive a connection ID for subsequent operations.

Endpoint: POST /v1/connect/new-connection

Headers:

  • Content-Type: application/json
  • X-Org - Your organization identifier
  • Environment - Your environment name
  • ProjectKey - Your project key
  • Authorization: Bearer {token} - Your JWT token

Request Body:

{
"username": "your_username",
"first_name": "first_name",
"last_name": "last_name"
}

Response:

{
"status": 200,
"data": {
"connection_id": "unique_connection_identifier"
},
"message": "Connection ID generated successfully"
}

Code Examples

// Using fetch API
const createConnection = async (token) => {
const response = await fetch('https://dev.arealtimetech.com/ws/v1/connect/new-connection', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Org': 'your_organization',
'Environment': 'your_environment',
'ProjectKey': 'your_project_key',
'Authorization': `Bearer ${token}`
},
body: JSON.stringify({
username: "your_username",
first_name: "first_name",
last_name: "last_name"
})
});

const data = await response.json();
console.log('Connection ID:', data.data.connection_id);
console.log('Status:', data.status);
return data.data.connection_id;
};

// Call the function with your JWT token
const connectionId = await createConnection('your_jwt_token');