# Registration and grid APIs

## Overview

Breakroom APIs require specific access to be granted to your account. If you are the World Owner, this access should be automatically enabled on your user account.

In this section of the documentation, you will see Breakroom Worlds referred to as *grids*. Because Breakroom is based on the Sinespace virtual world platform, you may also see the name *Sinespace* used instead of Breakroom.

{% hint style="info" %}
You may send parameters as either POST form\_data, or as Query parameters on the URL.
{% endhint %}

{% hint style="info" %}
**All APIs require you send three additional POST parameters:**`adminname, adminpwd,`and `gridid.`These should be the username and password of an account on the grid with administrator rights, along with the grid with which you intend to interface. We recommend creating a new user for this role specifically.
{% endhint %}

## User Management APIs <a href="#user-management-apis" id="user-management-apis"></a>

### Register User <a href="#register-user" id="register-user"></a>

<mark style="color:green;">`POST`</mark> `https://sine.space/worldapi/externalapi/add_user`

This endpoint allows you to register new users automatically.

**Query Parameters**

<table><thead><tr><th width="153">Name</th><th width="90">Type</th><th>Description</th></tr></thead><tbody><tr><td>gridid</td><td>integer</td><td>The unique grid ID where the user will be registered.</td></tr><tr><td>password</td><td>string</td><td>The user's initial password.</td></tr><tr><td>email</td><td>string</td><td>The user's e-mail address. We will not send any messages to this address unless requested by the user (e.g., password reset).</td></tr><tr><td>username</td><td>string</td><td>The desired username. If a particular username is already taken, an iteration on the provided name will be assigned to the account (e.g. "User Name01").</td></tr><tr><td>playeroutfitid</td><td>integer</td><td>The "Outfit ID" the user should be wearing when they first log in. As this creates "free" copies of items that may be listed as paid items on the Sine Wave Shop, the creator of the items must be an Administrator of the grid in question.</td></tr></tbody></table>

{% tabs %}
{% tab title="200 User account has been created." %}

```
<?xml version="1.0" encoding="utf-8"?>
<AddUserResponse><UserID>2099396</UserID></AddUserResponse>
```

{% endtab %}

{% tab title="400 Bad or invalid input, or similar." %}

```
<?xml version="1.0" encoding="utf-8"?>
<Response><code>0</code><message>A user account with that name already exists.</message></Response>
```

{% endtab %}
{% endtabs %}

### Delete User

<mark style="color:green;">`POST`</mark> `https://sine.space/worldapi/externalapi/delete_user`

Deletes or disables a user account.

#### Path Parameters

<table><thead><tr><th width="136">Name</th><th width="119">Type</th><th>Description</th></tr></thead><tbody><tr><td>userid</td><td>integer</td><td>The user ID associated with the user account.</td></tr></tbody></table>

{% tabs %}
{% tab title="200 " %}

```
<?xml version="1.0" encoding="utf-8"?>
<Response><code>1</code><message></message></Response>
```

{% endtab %}
{% endtabs %}

### Update User

<mark style="color:green;">`POST`</mark> `https://sine.space/worldapi/externalapi/update_user`

Changes information about a user account.

#### Query Parameters

<table><thead><tr><th width="136">Name</th><th width="102">Type</th><th>Description</th></tr></thead><tbody><tr><td>userid</td><td>integer</td><td>The user ID associated with the user account.</td></tr><tr><td>email</td><td>string</td><td>Updates the user's e-mail address.</td></tr><tr><td>password</td><td>string</td><td>Updates the user's password.</td></tr></tbody></table>

{% tabs %}
{% tab title="200 " %}

```
<?xml version="1.0" encoding="utf-8"?>
<Response><code>1</code><message></message></Response>
```

{% endtab %}
{% endtabs %}

### Get User

<mark style="color:green;">`POST`</mark> `https://sine.space/worldapi/externalapi/get_users`

Returns a bulk list of users associated with the grid.

#### Query Parameters

<table><thead><tr><th width="105">Name</th><th width="98">Type</th><th>Description</th></tr></thead><tbody><tr><td>userids</td><td>string</td><td>A comma separated list of user IDs you are interested in returning information about.</td></tr><tr><td>offset</td><td>integer</td><td>The query will return a maximum of 100 records. If more are available, use "offset" to return past this point.</td></tr></tbody></table>

{% tabs %}
{% tab title="200 " %}

```
<?xml version="1.0" encoding="utf-8"?>
<GetUsersResponse><Users><UserID>2099560</UserID><UserName>username</UserName><Email>username@test1.com</Email><Gender>M</Gender></Users><Users><UserID>2099559</UserID><UserName>username2</UserName><Email>username2@test1.com</Email><Gender>F</Gender></Users></GetUsersResponse>
```

{% endtab %}
{% endtabs %}

### Get User By Email

<mark style="color:green;">`POST`</mark> `https://sine.space/worldapi/externalapi/get_user_by_email`

Retrieves information about an individual user via their email address.

#### Query Parameters

<table><thead><tr><th width="109">Name</th><th width="81">Type</th><th>Description</th></tr></thead><tbody><tr><td>email</td><td>string</td><td>The e-mail address associated with the account.</td></tr></tbody></table>

{% tabs %}
{% tab title="200 " %}

```
<?xml version="1.0" encoding="utf-8"?>
<GetUserResponse><UserID>2099560</UserID><UserName>username</UserName><Email>username@test1.com</Email><Gender>M</Gender></GetUserResponse>
```

{% endtab %}
{% endtabs %}

### Update Login Region

<mark style="color:green;">`POST`</mark> `https://sine.space/worldapi/externalapi/update_login_region`

Updates the user, and sets their login scene to the specified ID.

#### Query Parameters

<table><thead><tr><th width="127">Name</th><th width="93">Type</th><th>Description</th></tr></thead><tbody><tr><td>userid</td><td>integer</td><td>The particular user whose login scene you want to update.</td></tr><tr><td>regionid</td><td>integer</td><td>The scene you want to set as the user's login scene. Set to zero to return to grid default.</td></tr></tbody></table>

{% tabs %}
{% tab title="200 " %}

```
<?xml version="1.0" encoding="utf-8"?>
<Response><code>1</code><message></message></Response>Region APIs
Create Region
Creates a new region on the grid
The user ID to be marked as owner of the region
The item ID for the region template to use
Either "0" for no access, "1" for free-for-all access, "2" for friends-only access, and "3" for approved only access.
The name of the region you wish to create
Region was created successfully
<?xml version="1.0" encoding="utf-8"?>
<CreateRegionResponse><RegionID>152860</RegionID></CreateRegionResponse>
An error was found in the inputs
<?xml version="1.0" encoding="utf-8"?>
<Response><code>0</code><message>Room template not available, please try another.</message></Response>
Set Region Role

The ID of the region
The ID of the user in question
Either "Normal", "Admin", or "Blocked".

<?xml version="1.0" encoding="utf-8"?>
<Response><code>1</code><message></message></Response>

<?xml version="1.0" encoding="utf-8"?>
<Response><code>0</code><message>The data provided is incorrect:  role = abc</message></Response>
Get Regions
Requests a list of regions on the Grid
Offsets the results if there is too many to return in a single query.
Return regions owned by this account
A CSV separated list of region IDs to return information about.

<?xml version="1.0" encoding="utf-8"?>
<GetRegionsResponse><Regions><RegionID>50000040</RegionID><RegionName>regionname</RegionName><Owner>2099564</Owner><TemplateID>11</TemplateID><AccessLevel>3</AccessLevel></Regions><Regions><RegionID>50000039</RegionID><RegionName>regionname2</RegionName><Owner>2099563</Owner><TemplateID>11</TemplateID><AccessLevel>1</AccessLevel></Regions><GetRegionsResponse>
Update Region
Updates information about a particular region
The region ID to update information about
If present, changes the name of the region
If present, changes the template of the region to the specified template ID
Either "0" - no access, "1" - free access, "2" friends-only access, and "3" approved only access.
```

{% endtab %}
{% endtabs %}

## Region APIs

### Create Region

<mark style="color:green;">`POST`</mark> `https://sine.space/worldapi/externalapi/create_region`

Creates a new Region on the grid.

#### Query Parameters

<table><thead><tr><th width="156">Name</th><th width="103">Type</th><th>Description</th></tr></thead><tbody><tr><td>owner</td><td>integer</td><td>The user ID to be marked as owner of the Region.</td></tr><tr><td>templateid</td><td>integer</td><td>The item ID for the Region template to use.</td></tr><tr><td>accesslevel</td><td>integer</td><td>Either "0" for no access, "1" for free-for-all access, "2" for friends-only access, and "3" for approved only access.</td></tr><tr><td>regionname</td><td>string</td><td>The name of the Region you wish to create.</td></tr></tbody></table>

{% tabs %}
{% tab title="200 Region was created successfully." %}

```
<?xml version="1.0" encoding="utf-8"?>
<CreateRegionResponse><RegionID>152860</RegionID></CreateRegionResponse>
```

{% endtab %}

{% tab title="400 An error was found in the inputs." %}

```
<?xml version="1.0" encoding="utf-8"?>
<Response><code>0</code><message>Room template not available, please try another.</message></Response>
```

{% endtab %}
{% endtabs %}

### Set Region Role

<mark style="color:green;">`POST`</mark> `https://sine.space/worldapi/externalapi/set_region_role`

Sets or changes a user's role within a particular Region.

#### Query Parameters

<table><thead><tr><th width="119">Name</th><th width="91">Type</th><th>Description</th></tr></thead><tbody><tr><td>regionid</td><td>integer</td><td>The ID of the Region.</td></tr><tr><td>userid</td><td>integer</td><td>The ID of the user in question.</td></tr><tr><td>role</td><td>string</td><td>Either "Normal," "Admin," or "Blocked."</td></tr></tbody></table>

{% tabs %}
{% tab title="200 " %}

```
<?xml version="1.0" encoding="utf-8"?>
<Response><code>1</code><message></message></Response>
```

{% endtab %}

{% tab title="400 " %}

```
<?xml version="1.0" encoding="utf-8"?>
<Response><code>0</code><message>The data provided is incorrect:  role = abc</message></Response>
```

{% endtab %}
{% endtabs %}

### Get Regions

<mark style="color:green;">`POST`</mark> `https://sine.space/worldapi/externalapi/get_regions`

Requests a list of Regions on the grid.

#### Query Parameters

<table><thead><tr><th width="125">Name</th><th width="101">Type</th><th>Description</th></tr></thead><tbody><tr><td>offset</td><td>integer</td><td>Offsets the results if there are too many to return in a single query.</td></tr><tr><td>owner</td><td>integer</td><td>Return Regions owned by a particular owner's account.</td></tr><tr><td>regionids</td><td>string</td><td>A CSV list of Region IDs to return information about.</td></tr></tbody></table>

{% tabs %}
{% tab title="200 " %}

```
<?xml version="1.0" encoding="utf-8"?>
<GetRegionsResponse><Regions><RegionID>50000040</RegionID><RegionName>regionname</RegionName><Owner>2099564</Owner><TemplateID>11</TemplateID><AccessLevel>3</AccessLevel></Regions><Regions><RegionID>50000039</RegionID><RegionName>regionname2</RegionName><Owner>2099563</Owner><TemplateID>11</TemplateID><AccessLevel>1</AccessLevel></Regions><GetRegionsResponse>
```

{% endtab %}
{% endtabs %}

### Update Region

<mark style="color:green;">`POST`</mark> `https://sine.space/worldapi/externalapi/update_region`

Updates information about a particular Region.

#### Query Parameters

<table><thead><tr><th width="147">Name</th><th width="103">Type</th><th>Description</th></tr></thead><tbody><tr><td>regionid</td><td>integer</td><td>The Region ID to update information about.</td></tr><tr><td>regionname</td><td>string</td><td>If present, changes the name of the Region.</td></tr><tr><td>templateid</td><td>integer</td><td>If present, changes the template of the Region to the specified template ID.</td></tr><tr><td>accesslevel</td><td>integer</td><td>Either "0" - no access, "1" - free access, "2" - friends-only access, and "3" - approved only access.</td></tr></tbody></table>

{% tabs %}
{% tab title="200 " %}

```
<?xml version="1.0" encoding="utf-8"?>
<Response><code>1</code><message></message></Response>
```

{% endtab %}
{% endtabs %}
