Download OpenAPI specification:Download
Presence manages the user, room, and tool data. It also handles sending room invitations and OTPs.
POST /disconnect
This endpoint forces a signed in user to leave any room they are in and "disconnect" from presence.
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
{ }GET /invites:
If a user has been invited to a room, then this endpoint will return that invitation's data. This invitation will be in a list and will contain the information about the room and who invited them. A list may contain more than one roomInvitation.
On the frontend, the user will be able to view these invitations as cards at the top of the dashboard. These cards will allow the user to accept the invitation & join the invited room. If a user does not have any pending invitations, then this view will not show.
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
[- {
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "created": 1745972654050,
- "modified": 1745972655891,
- "uid": "testUser@google.com",
- "room": "2fa2a266-7d97-4147-8f17-1e57105c70ea",
- "shortname": "alpacas-love-underwater-basketweaving",
- "name": "Test Room",
- "invitedDate": 1745972655891,
- "invitedBy": {
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "name": "SME Test User",
- "uid": "SMEUser@turnaroundfactor.com"
}
}
]POST /invites
If a user is in a room, they may send an email invitation to another user. This endpoint will pre-approve a different user for the room and send them an email invitation with a link to the room. This means that they will not require approval before joining the room and will be able to immediately join the room.
The other user will receive an email that contains a URL to the invited room. The user will also know
that they have been invited to the room when they go to the SME Connect dashboard. The get request
of the invites endpoint will retrieve their pending room invitations.
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
User & email information
| emailAddress | string <email> The email of invited user |
| uuid | string <uuid> The UUID of user sending invite |
| send_email | boolean If true, email will be sent. If false, email will not be sent, user will still be pre-approved to room. |
{- "emailAddress": "testUser@google.com",
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9",
- "send_email": true
}trueGET /jwt
This endpoint is called when a user enter a room.
jwt provides the user with a JSON Web Token that will be used to log the user into the assets service.
This will grant them privileges in viewing and annotating documents/image/CAD models.
Each JWT is specific to the individual room that the user is in.
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
| x-adapt-host | string |
| x-adapt-handler | string |
| x-adapt-url | string |
{- "token": "eyJhbGciOiJFUzM4NCIsImtpZCI6InRhZi1hZGFwdC1wcmV.zZW5jZS1tZWRpYS1zZXJ2ZXJsZXNzOjVlM2I0ZmRlZGU2Z.jRmZmY5ZDkwOTZlNDYxZTViOGI2In0"
}GET /login
The login process occurs once a user has a valid JWT token provided by the auth service. When a user logs into SME Connect, the presence login
endpoint will create a valid service session and return a session cookie to the user. This cookie is valid for a 2 hour window. The session cookie
stores the user's credentials, which will provide authorization for interacting with the different presence services, such as
joining and creating rooms.
When a user logs into presence for the first time, the user will have a new User record created. This record will originally contain just their name,
uid (email), and uuid (unique ID).
| x-adapt-host | string |
| x-adapt-handler | string |
| x-adapt-url | string |
{- "session": {
- "auth_source": {
- "name": "smeconnect.dev",
- "code": "adapt-authn-serverless.additional-information.azure",
}, - "subject": "1234567891000000000000",
- "uid": "testUser@turnaroundfactor.com",
- "name": "Test User",
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f"
}
}GET /logout
The logout endpoint is called when a user selects to log out of SME Connect through the frontend. This endpoint will expire the user's cookie
and end their current session. A 200 response indicates success.
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
{- "error": "Unable to logout of user session"
}GET /negotiate
This endpoint will negotiate a user's connection to Web PubSub. It will confirm a user has an existing session, and if valid, will return connection details on how to connect with Web PubSub. This endpoint will provide the endpoint for the Web PubSub and a JWT for accessing it.
| uuid required | string <uuid> The unique ID of the user |
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
{- "path": "/hubs/example",
- "token": "ey12345667.ey2jlk29fsdf.134359jfklsj"
}POST /otp/send
The endpoint is called when a user requests to log into SME Connect with just an email. A hashed version of an OTP is stored in the presence DB along with the salt and user's email. This data will be used in the validate endpoint (otp/validate). Users will receive an email notifying them of their OTP. This 8-digit passcode will have a 15-minute window to use and validate.
Users that log in with just an email may experience restrictions with their account. These restrictions are intentional as specific login methods, such as CAC, are the authorized ways of logging in.
| emailAddress | string <email> The email of user requesting OTP |
| displayName | string >= 2 characters The name of the user requesting OTP |
{- "emailAddress": "testUser@turnaroundfactor.com",
- "displayName": "Test User"
}truePOST /otp/validate
This endpoint validates an OTP that a user submits. The OTP should have been generated first by /otp/send and retrieved from an email that contained the valid OTP.
This endpoint will validate the OTP that the user provides by checking the user-submitted OTP with the
stored hashed version found in the presence DB. If the OTP matches what is stored in the DB, then
the endpoint will return a valid JWT token for js_common to then use to send to the authn endpoint.
This will ultimately allow the user to log into all SME Connect services having used just their email.
NOTE: Users will experience restrictions to their account when signing in with just their email and an OTP. Restrictions will include not being able to create a room.
| p | string <number> = 8 characters The OTP a user provides. Must be numeric values. |
| e | string <email> The email of user requesting OTP |
| n | string >= 2 characters The name of the user requesting OTP |
{- "p": "12345678",
- "e": "testUser@turnaroundfactor.com",
- "n": "Test User"
}{- "email": "testUser@turnaroundfactor.com",
- "name": "Test User",
- "token": {
- "token": "eyJhbGciOiJFUzM4NCIsImtpZCI6InRhZi1hZGFwdC1wcmV.zZW5jZS1tZWRpYS1zZXJ2ZXJsZXNzOjVlM2I0ZmRlZGU2Z.jRmZmY5ZDkwOTZlNDYxZTViOGI2In0",
- "user_info": {
- "auth_source": {
- "name": "smeconnect.dev",
- "code": "adapt-authn-serverless.additional-information.azure",
}, - "subject": "1234567891000000000000",
- "uid": "testUser@turnaroundfactor.com",
- "name": "Test User",
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f"
}, - "token_info": {
- "name": "smeconnect.dev",
- "code": "adapt-authn-serverless.additional-information.azure",
}
}
}POST /rooms/approve/{uuid:guid}
In the flow of SME Connect, this endpoint will occur once a user has requested to join a room. If they
have not been previously approved for the room, then two SOCKET.IO events will be triggered. This first will be
to notify users already in the room that someone has requested to join. The 2nd will be to send the requesting user to
wait until they are approved.
Users in the room will see a "Approve" button notifying them of a user requesting to join the room. If a user
clicks Approve, then this endpoint will be called.
This endpoint will check that the user who is approving someone is currently in the requested room. Upon a successful completion of this endpoint, the following will have happened:
userRoom entry in the presence DB. This indicates that they are now approved for
the room and do not need future approvals.socket event will tell existing users that a new user joined the room. This will help establish WebRTC connections.socket room. (Note -- the Tools Gateway will not have a socketID and will not complete this
step. This will prevent unnecessary socket connections to the Tools Gateway)Notes about the approval process:
| uuid required | string <uuid> Example: 095be615-a8ad-4c33-8e9c-c7612fbf6c9 The unique ID of the user needing approval to join room |
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
{ }POST /rooms
An authorized user may create a room. An authorized user is determined by their email and method of login. For example, a user is authorized if they log in with their CAC card and email has some version of "@mil" in it. If a user is unauthorized, they will not be able to create a room.
This endpoint will achieve the following:
userRoomOn the front-end, the user will be put in the waiting area where they can then join the room's session by clicking on the "Join Session" button.
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
| name | string <number> >= 2 characters The name of the room. Characters may not include - "_" |
{- "name": "Test Room"
}{- "uuid": "2fa2a266-7d97-4147-8f17-1e57105c70ea",
- "name": "Test Room",
- "shortname": "some-four-random-words",
- "members": [
- {
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "name": "Test User",
- "device": "WebUI",
- "type": "RemoteExpert",
- "created": 1641878641225,
- "modified": 1742570520135,
- "method": "google",
- "room": "2fa2a266-7d97-4147-8f17-1e57105c70ea"
}
]
}GET /rooms
This endpoint will return a list of rooms that a user is approved to join. The rooms list will include any members who are currently in the room. If a user has not been approved for any room, then an empty array will be returned.
This request may include different parameters to narrow the list of approved rooms. For example,
there may be a modified or created parameter included with this request. This will filter the results
based on a specified timestamp.
| modified | integer Example: modified=1742570520135 The UNIX timestamp of a modified date. Request will filter all rooms modified after the timestamp. |
| created | integer Example: created=1641878641225 The UNIX timestamp of a created date. Request will filter all rooms created after the timestamp. |
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
[- {
- "name": "Test Room",
- "shortname": "some-four-random-words",
- "uuid": "2fa2a266-7d97-4147-8f17-1e57105c70ea",
- "members": [
- {
- "name": "Test User",
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "device": "WebUI",
- "method": "google",
- "room": "2fa2a266-7d97-4147-8f17-1e57105c70ea",
- "type": "RemoteExpert",
- "created": 1641878641225,
- "modified": 1742570520135
}
]
}
]GET /rooms/{uuid}
This endpoint will return a room's data, including a members list, based on the provided UUID. A members list will only be provided if the user has been previously approved for that room.
| uuid required | string <uuid> Example: 2fa2a266-7d97-4147-8f17-1e57105c70ea The unique ID of the requested room |
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
{- "name": "Test Room",
- "shortname": "some-four-random-words",
- "uuid": "2fa2a266-7d97-4147-8f17-1e57105c70ea",
- "members": [
- {
- "name": "Test User",
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "device": "WebUI",
- "method": "google",
- "room": "2fa2a266-7d97-4147-8f17-1e57105c70ea",
- "type": "RemoteExpert",
- "created": 1641878641225,
- "modified": 1742570520135
}
]
}GET /rooms/{shortname}
This endpoint will return a room's data, including a members list, based on the provided shortname. A members list will only be provided if the user has been previously approved for that room.
| shortname required | stringregex(^[a-z-]+$) Example: some-four-random-words The room shortname |
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
{- "name": "Test Room",
- "shortname": "some-four-random-words",
- "uuid": "2fa2a266-7d97-4147-8f17-1e57105c70ea",
- "members": [
- {
- "name": "Test User",
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "device": "WebUI",
- "method": "google",
- "room": "2fa2a266-7d97-4147-8f17-1e57105c70ea",
- "type": "RemoteExpert",
- "created": 1641878641225,
- "modified": 1742570520135
}
]
}GET /user
This endpoint returns a user's information. This endpoint will only return a user's own record and information. A user may not get another's information from this endpoint. This is determined by the user's session information.
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
{- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "name": "Test User",
- "device": "WebUI",
- "type": "RemoteExpert",
- "created": 1641878641225,
- "modified": 1742570520135,
- "method": "google",
- "room": "2fa2a266-7d97-4147-8f17-1e57105c70ea",
- "permissions": [
- "rooms_create",
- "room_kick"
]
}DELETE /user
This endpoint will clear a user's approved rooms data. Once completed, a user will need
to regain approval for any previously joined room. In the DB, the user's userRoom items
will be removed.
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
trueThis endpoint will create/update a new user in the DB. The data from this new record will be returned in the response.
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
User information
| uuid | string <uuid> The unique ID of the user |
| uid | string <email> The user's email address |
| name | string The user's name |
| device | string Enum: "WebUI" "iPad" "EmbeddedNode" "DMM-v1" "Boroscope-v1" "OpticalMicrometer-v1" "GenericCamera-v1" The device the user is using |
| type | string Enum: "RemoteExpert" "OnSiteUser" "EmbeddedNode" "Tool" The user's device type |
| method | string Enum: "google" "apple" "cac" "email" The login method the user used |
{- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "uid": "user@example.com",
- "name": "User Name",
- "device": "WebUI",
- "type": "RemoteExpert",
- "method": "google"
}{- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "name": "Test User",
- "device": "WebUI",
- "type": "RemoteExpert",
- "created": 1641878641225,
- "modified": 1742570520135,
- "method": "google",
- "room": "2fa2a266-7d97-4147-8f17-1e57105c70ea",
- "permissions": [
- "rooms_create",
- "room_kick"
]
}This endpoint will update a user record in the DB. The serialized user data will be returned.
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
User information
| uuid | string <uuid> The unique ID of the user |
| uid | string <email> The user's email address |
| name | string The user's name |
| device | string Enum: "WebUI" "iPad" "EmbeddedNode" "DMM-v1" "Boroscope-v1" "OpticalMicrometer-v1" "GenericCamera-v1" The device the user is using |
| type | string Enum: "RemoteExpert" "OnSiteUser" "EmbeddedNode" "Tool" The user's device type |
| method | string Enum: "google" "apple" "cac" "email" The login method the user used |
{- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "uid": "user@example.com",
- "name": "User Name",
- "device": "WebUI",
- "type": "RemoteExpert",
- "method": "google"
}{- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "name": "Test User",
- "device": "WebUI",
- "type": "RemoteExpert",
- "created": 1641878641225,
- "modified": 1742570520135,
- "method": "google",
- "room": "2fa2a266-7d97-4147-8f17-1e57105c70ea",
- "permissions": [
- "rooms_create",
- "room_kick"
]
}This endpoint returns a user's information based on the provided UUID. This endpoint will only return the requested user if the requesting user is of type "Tool". This endpoint is needed so that a "Tool" may now what room the Tools Gateway (EmbeddedNode) is in. If a user of any other type calls this endpoint, that user will only receive their own information.
| uuid required | string <uuid> The unique ID of the requested user |
| sess{Unique ID} required | string Example: sess{Unique ID}=sess38b9de00=12345678-9abc-4f44-9aba-773c5a9d3465 The session cookie from the Presence service |
{- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "name": "Test User",
- "device": "WebUI",
- "type": "RemoteExpert",
- "created": 1641878641225,
- "modified": 1742570520135,
- "method": "google",
- "room": "2fa2a266-7d97-4147-8f17-1e57105c70ea",
- "permissions": [
- "rooms_create",
- "room_kick"
]
}