XRCLOUD API (1.1)

Download OpenAPI specification:Download

Authentication

All API calls in this document require an ApiKey.

  • You can obtain the ApiKey from My page in the upper right corner after logging into the XRCLOUD page.

Webhook

XRCLOUD delivers event logs to the configured webhook URL whenever specific Room and Scene events occur.

Room Events

  • room-join: User enters a Room
  • room-exit: User exits a Room
  • room-video-click-event: Video click event in Room

Scene Events

  • scene-created: Scene creation
  • scene-updated: Scene modification

Webhook Request Information

  • Method: POST
  • Headers:
    • Content-Type: application/json
    • X-Forwarded-For: User IP

Request Data Format

{
  "code": "room-join",              // Type of event that occurred
  "resourceId": "uuid",            // Room/Scene ID
  "sessionId": "uuid",             // Session ID
  "reticulumId": "string",         // XRCLOUD(Hubs) user ID
  "logTime": "2024-01-01T00:00:00Z", // Timestamp when the event occurred
  "action": "string",              // Specific action performed (e.g., "enter", "exit")
  "ip": "string",                  // User IP (extracted from X-Forwarded-For header)
  "userAgent": "string",           // User browser information
  "device": "string"               // User's device type (pc/mobile/vr)
}```

**Note**: 
- The webhook URL can be set when creating or modifying a Project.
- Currently, ip and userAgent values may not be transmitted correctly.
- If the webhook request response returns a status code of 300 or higher, it will be treated as an error.

Project

A Project in XRCLOUD can be a developer's project, platform, or 3rd-party application. It serves as a management unit for Scenes and Rooms, where multiple Scenes and Rooms can belong to a specific Project.

Retrieve Projects by Label

Fetch projects filtered by label. Use the label query parameter to filter projects by a specific label.

query Parameters
label
string

The label of the project to filter. If not provided, all projects will be returned.

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Responses

Response samples

Content type
application/json
[]

Create a Project

You can create a project using the following format:

RES=$(curl -s -X POST "$XRCLOUD_HOST/api/projects" \
    -H "Authorization: Bearer $ACCESS_TOKEN" \
    -H "Content-Type: multipart/form-data" \
    -F "favicon=@$FILE_DIR/favicon.ico" \
    -F "logo=@$FILE_DIR/logo.png" \
    -F "name=lms" \
    -F "label=lms"
)

This API uses multipart/form-data format to include the favicon, logo, name, and label of the project.

Request Body schema: multipart/form-data
required
favicon
string <binary>

Favicon file for the project.

logo
string <binary>

Logo file for the project.

name
string

Name of the project.

label
string

Label of the project.

Responses

Response samples

Content type
application/json
{}

Retrieve or Generate XRCLOUD User ID

Pass a user ID from your service to generate and retrieve a reticulumId (XRCLOUD's user ID) in XRCLOUD. This user ID is used in other APIs to identify specific user actions on the platform. Logging information will be reported using this reticulumId.

path Parameters
projectId
required
string

Unique ID of the project.

accountId
required
string

Account ID of the user.

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Responses

Response samples

Content type
application/json
{ }

Retrieve Project Information

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Responses

Response samples

Content type
application/json
{}

Scene

A space for creating web-based 3D virtual environments that are required for Room creation.

To create a Scene, call the get-creation-url api to obtain the 'sceneCreationUrl', access the editor (Spoke), and click the Publish Scene button in the upper right corner. You can also modify existing Scenes by accessing the 'sceneModificationUrl' field obtained from the get-scene api.

  • The optId value is a callback value used by XRCLOUD to verify Scene creation and modification. Modifying it may cause errors.

Retrieve Scene List Information

query Parameters
projectId
required
uuid

Unique ID of the Project.

name
string

(search) Retrieve objects with the specified name.

creator
string

(search) Retrieve objects created by a specific creator.

take
number

(pagination) The number of items to retrieve.

skip
number

(pagination) The number of items to skip.

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Responses

Response samples

Content type
application/json
{}

Retrieve Scene Editor (Spoke) URL

query Parameters
projectId
required
uuid

Unique ID of the Project.

creator
string

You can specify the creator of the Scene. It is used to distinguish between 'My Assets' for each user. If you call without this parameter, it will be treated as if it was created by 'Admin'.

callback
string
Example: callback=https://api.xrcloud.app/rooms

You can call this if you need a specific action after creating the Scene (such as creating a Room immediately after creating the Scene). The call from XRCloud will be as follows.

{ method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ sceneId }) }

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Responses

Response samples

Retrieve Scene Information

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Responses

Response samples

Content type
application/json
{}

Remove a Scene

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Responses

Response samples

Content type
application/json
{
  • "statusCode": 400,
  • "method": "Method",
  • "url": "/example/endpoint",
  • "body": {
    },
  • "message": "Detailed error messages"
}

Room

A Room is a virtual space based on a Scene created through the editor (Spoke).

Each Room provides two types of URLs: a private room URL that changes with each request and a public room URL with a fixed address. These URLs are further divided into host URLs that grant host permissions and guest URLs that grant guest permissions.

The 'returnUrl' specifies the web address to return to when leaving the room, which can be configured in the Rooms tab of XRCloud.

Create a Room

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Request Body schema: application/json
required
projectId
required
uuid

Unique ID of the Project.

sceneId
required
uuid

Unique ID of the Scene.

name
required
string

Name of the Room.

returnUrl
required
string

URL to return to when leaving the Room.

size
number

Maximum number of people that can enter the Room.

Responses

Request samples

Content type
application/json
{
  • "projectId": "f24ee5ba-8f1f-4f7a-86ed-738f95ea1f8b",
  • "sceneId": "1234e5ba-5678-4f7a-86ed-abcd95ea1efg",
  • "name": "example room name",
  • "returnUrl": "https://www.google.com/",
  • "size": 10
}

Response samples

Content type
application/json
{}

Retrieve Room List Information

This API must include either projectId or sceneId.

query Parameters
projectId
uuid

Unique ID of the Project.

sceneId
uuid

Unique ID of the Scene.

name
string

(search) Retrieve objects with the specified name.

userId
string

User of the Project (app). It is used to distinguish between users who enter the Room.

avatarUrl
string
Example: avatarUrl=https://storage.com/bucket/avatar-file.glb

The path to the avatar file for the Room.

linkPayload
string
Example: linkPayload=userName:Tom|UserGrade:10

The value to be passed to the 'InlineView' element of the Scene. It will be passed to the URL called by the InlineView in the hubsParam parameter.

take
number

(pagination) The number of items to retrieve.

skip
number

(pagination) The number of items to skip.

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Responses

Response samples

Content type
application/json
{}

Retrieve Room Information

query Parameters
userId
string

User of the Project (app). It is used to distinguish between users who enter the Room.

avatarUrl
string
Example: avatarUrl=https://storage.com/bucket/avatar-file.glb

The path to the avatar file for the Room.

linkPayload
string
Example: linkPayload=userName:Tom|UserGrade:10

The value to be passed to the 'InlineView' element of the Scene. It will be passed to the URL called by the InlineView in the hubsParam parameter.

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Responses

Response samples

Content type
application/json
{}

Update Room Information

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Request Body schema: application/json
required
name
string

Name of the Room.

size
number

Maximum number of people that can enter the Room.

returnUrl
string

URL to return to when leaving the Room.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{}

Remove a Room

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Responses

Response samples

Content type
application/json
{
  • "statusCode": 400,
  • "method": "Method",
  • "url": "/example/endpoint",
  • "body": {
    },
  • "message": "Detailed error messages"
}

Retrieve Room Logs

Retrieve the user's participation logs for a specific room. This log includes the time, IP address, device information, etc. of the user who joined the room. (As of 2024-12-01, the IP address and UserAgent are not being sent correctly.)

header Parameters
X-XRCLOUD-API-KEY
required
string

You must include the ApiKey in the header in the following format: X-XRCLOUD-API-KEY: ${ApiKey}.

Responses

Response samples

Content type
application/json
[
  • {
    }
]