# Show how to connect to a web hosting package

> Host, protocols and ports for FTP, SSH and mail programs of one web hosting package.

- Effect: Read - Changes nothing.
- Idempotent: yes
- Stability: beta
- MCP tool: `manitu_webhosting_connection_get` on https://mcp.manitu.de/mcp
- REST: `POST https://api.manitu.de/v1/webhosting/connection/get`
- Needs: `service_webhosting`
- Page: /reference/webhosting/connection/get/

## MCP tool

`manitu_webhosting_connection_get`

### Description for the model

Returns how to connect to a web hosting package of the manitu customer account this connection works in, by its site_id from manitu_webhosting_list - for "how do I connect?", "what do I enter in my mail program / FTP program?": ftp (host, protocols with ports - SFTP on port 23, not 22), ssh (host, port, key login only, host key fingerprints) and mail (the server for mail programs - IMAP, POP3, SMTP - with ports and security; NOT the MX server). The user name is each user's own: FTP and SSH users from their list tools, for mail the full address of the mailbox. Passwords are never shown.

### Arguments

- `site_id` (integer | string, required) - The site_id from manitu_webhosting_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)

### Example

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "manitu_webhosting_connection_get",
    "arguments": {
      "site_id": 12345
    }
  }
}
```

## REST

`POST https://api.manitu.de/v1/webhosting/connection/get`

### Authentication

One of `X-API-Key`, `Authorization: Bearer …` - never more than one in a request.

### Request body

JSON; unknown fields are refused.

- `site_id` (integer | string, required) - The site_id from manitu_webhosting_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)

### Response

In `data`; the rest of the body as on every call.

- `ftp` (object | null, required) - FTP - null if the package has no web part.
  - `ftp.host` (string | null, required) - The host to connect to - the web server of the package.
  - `ftp.method_list` (array of object, required) - The ways to connect, the one to prefer first. SFTP is on port 23, NOT 22; implicit FTPS is not offered; plain FTP (unencrypted) only if nothing else works.
    - `ftp.method_list[].protocol` (string, required) - sftp (SSH file transfer), ftps_explicit (FTP with explicit TLS, AUTH TLS), ftp (unencrypted). (one of `"sftp"`, `"ftps_explicit"`, `"ftp"`)
    - `ftp.method_list[].port` (integer, required)
    - `ftp.method_list[].is_encrypted` (boolean, required)
    - `ftp.method_list[].is_recommended` (boolean, required)
  - `ftp.web_ftp_url` (string, required) - FTP in the browser, with the same user name and password.
- `ssh` (object | null, required) - SSH - null if the package has no web part.
  - `ssh.host` (string | null, required) - The host to connect to - the web server of the package.
  - `ssh.method_list` (array of object, required) - The ways to connect: SSH on port 22.
    - `ssh.method_list[].protocol` (string, required) - (one of `"ssh"`)
    - `ssh.method_list[].port` (integer, required)
    - `ssh.method_list[].is_encrypted` (boolean, required)
    - `ssh.method_list[].is_recommended` (boolean, required)
  - `ssh.auth` (string, required) - public_key_only: log in with a key from the user's ssh_key_list - a password does not work. (one of `"public_key_only"`)
  - `ssh.host_key_list` (array of object, required) - The server's host keys - on the first connection the SSH client shows one of these fingerprints; it must match.
    - `ssh.host_key_list[].algorithm` (string, required)
    - `ssh.host_key_list[].fingerprint_sha256` (string, required) - As the SSH client shows it, e.g. "SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8".
- `mail` (object | null, required) - Mail programs - null if the package has no mail part.
  - `mail.host` (string, required) - The server a mail program connects to - for receiving (IMAP, POP3) and sending (SMTP) alike. NOT the MX server of the package.
  - `mail.method_list` (array of object, required) - The ways to connect, per protocol the one to prefer first - encrypted only, there is no unencrypted way. Receiving: IMAP (mail stays on the server, several devices) or POP3 (mail is fetched); sending: SMTP with login (the same user name and password) - port 587 with STARTTLS where 465 is blocked.
    - `mail.method_list[].protocol` (string, required) - (one of `"imap"`, `"pop3"`, `"smtp"`)
    - `mail.method_list[].port` (integer, required)
    - `mail.method_list[].security` (string, required) - ssl_tls: encrypted from the start (often "SSL/TLS"); starttls: switched to encryption after connecting ("STARTTLS"). (one of `"ssl_tls"`, `"starttls"`)
    - `mail.method_list[].is_recommended` (boolean, required)

### Statuses

- `200` Success.
- `400` The request does not match the declared input schema.
- `401` No credential was presented, or it was not recognised.
- `403` The credential is not permitted to use this operation.
- `500` The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.
- `503` The channel this operation forwards through is unavailable.

### Example

```sh
curl -X POST 'https://api.manitu.de/v1/webhosting/connection/get' \
  -H 'X-API-Key: $API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"site_id":12345}'
```

## Example result

```json
{
  "ftp": {
    "host": "string",
    "method_list": [
      {
        "protocol": "sftp",
        "port": 1,
        "is_encrypted": true,
        "is_recommended": true
      }
    ],
    "web_ftp_url": "https://www.example.com/"
  },
  "ssh": {
    "host": "string",
    "method_list": [
      {
        "protocol": "ssh",
        "port": 1,
        "is_encrypted": true,
        "is_recommended": true
      }
    ],
    "auth": "public_key_only",
    "host_key_list": [
      {
        "algorithm": "string",
        "fingerprint_sha256": "string"
      }
    ]
  },
  "mail": {
    "host": "string",
    "method_list": [
      {
        "protocol": "imap",
        "port": 1,
        "security": "ssl_tls",
        "is_recommended": true
      }
    ]
  }
}
```
