# selectServer

**.selectServer(SessionID, serverCode)**

Select a server to edit for a session ID

| Parameter  | Type   | Required | Description                                             |
| ---------- | ------ | -------- | ------------------------------------------------------- |
| SessionID  | string | true     | The session of the account you want to select server on |
| serverCode | string | true     | The code of the server you want to select               |

**Example:**

```javascript
// Dependencies
const CubedCraft = require('cubed-api');

// Account Details
const username = 'ACCOUNT_USERNAME';
const password = 'ACCOUNT_PASSWORD';

// Server Details
const serverName = 'SERVER_NAME';

// Logging Into The Account
CubedCraft.login(username, password).then(ses => {

    // Getting All Of The User's Servers With Their Session ID
    CubedCraft.getServers(ses).then(servers => {
        const server = servers.find(s => s.name.toLowerCase() === serverName.toLowerCase());
        console.log(server.code);
    })
    
});
```

{% hint style="info" %}
Read the page on selecting a server for more information: <https://pondwadermc.gitbook.io/cubed-api/tutorials-and-guides/selecting-a-server-to-edit>
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pondwadermc.gitbook.io/cubed-api/documentation/selectserver.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
