Onboarding
Provides real-time updates regarding new user registrations from your application.
Subscription Instructions
Feed Name
private.enterprise.users
Payload Details
Key
Description
account_type
Individual or Corporation
account_role
Advisor or Client
user_id
Unique ID shared between sFOX and your enterprise
email
Email address of the user
first_name
First name of the user
last_name
Last name of the user
phone_number
Phone number of the user
status
Verification status of the user’s sFOX account
requirements
Status of verification requirements of the user's sFOX account
user_token
A User Auth Token for this partner_user_id .
The authentication token that your application will use to access this specific user’s account
Example Code
const WebSocket = require('ws')
const ws = new WebSocket('wss://ws.sfox.com/ws')
ws.on('open', function() {
const authMessage = {
type: 'authenticate',
apiKey: `process.env.ENTERPRISE_API_KEY`,
enterprise: 'true'
}
ws.send(JSON.stringify(authMessage))
})
// After successful authentication, subscribe to users feed
const subscribeMsg = {
type: 'subscribe',
feeds: ['private.enterprise.users']
}
ws.send(JSON.stringify(subscribeMsg))import asyncio
import json
import websockets
import os
async def main(uri):
async with websockets.connect(uri) as ws:
await ws.send(json.dumps({
"type": "authenticate",
"apiKey": f"{os.environ['ENTERPRISE_API_KEY']}",
"enterprise": "true"
}))
# After successful authentication message, subscribe to the users feed
await ws.send(json.dumps({
"type": "subscribe",
"feeds": ["private.enterprise.users"]
}))
async for msg in ws:
print(msg)
asyncio.run(main("wss://ws.sfox.com/ws")){
"sequence": 5,
"recipient": "private.enterprise.users",
"timestamp": 1717005327995988841,
"payload": {
"user_id": "client_09e487c9-9b75-4ef5-be06-b3e5661f68e5",
"first_name": "Brando",
"last_name": "Marks",
"email": "[email protected]",
"phone_number": "+12223334444",
"account_role": "Client",
"account_type": "individual",
"status": "PENDING",
"user_token": {
"token": "2000611ea497d8ae4832c52166e0a26162cbb74716ab2662c50f8b47cdad3979",
"expires": "2024-05-30T17:55:27.981Z",
"partner_user_id": "client_09e487c9-9b75-4ef5-be06-b3e5661f68e5"
},
"requirements": {
"sms": true,
"email": true
}
}
}{
"sequence": 5,
"recipient": "private.enterprise.users",
"timestamp": 1717005327995988841,
"payload": {
"user_id": "client_09e487c9-9b75-4ef5-be06-b3e5661f68e5",
"first_name": "Brando",
"last_name": "Marks",
"email": "[email protected]",
"phone_number": "+12223334444",
"account_role": "Client",
"account_type": "individual",
"status": "VERIFIED",
"user_token": {
"token": "2000611ea497d8ae4832c52166e0a26162cbb74716ab2662c50f8b47cdad3979",
"expires": "2024-05-30T17:55:27.981Z",
"partner_user_id": "client_09e487c9-9b75-4ef5-be06-b3e5661f68e5"
},
"requirements": {
"sms": false,
"email": false
}
}
}Last updated