> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Make API Call

- Component: `appmixer.telegram.core.MakeApiCall`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.telegram 1.1.2](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.MakeApiCall>

Performs an arbitrary authorized call against the Telegram Bot API. The path is the Bot API method name, so `/sendMessage` is enough - the bot token is added automatically. Use this to reach methods this connector does not expose as their own component.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| API Endpoint Path (`url`) | text | Bot API method name, for example `/sendMessage` or `getChatMemberCount`. A full URL is accepted as long as it stays on `https://api.telegram.org`. |
| HTTP Method (`method`) | select | Telegram serves every Bot API method over both GET and POST - choose POST whenever there is a request body. PUT, PATCH and DELETE are offered for consistency only; the Bot API does not answer them. |
| Query Parameters (`parameters`) | key-value | Optional query parameters appended to the URL. |
| Request Body (`body`) | textarea | Enter the request body as a JSON object (supports nested objects, arrays, and non-string values). |
| Request Headers (`headers`) | key-value | Optional additional request headers. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Status Code (`status`) | - | - |
| Response Headers (`headers`) | - | - |
| Response Body (`body`) | object | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.telegram.core.MakeApiCall",
  "label": "Make API Call",
  "description": "Performs an arbitrary authorized call against the Telegram Bot API. The path is the Bot API method name, so <code>/sendMessage</code> is enough - the bot token is added automatically. Use this to reach methods this connector does not expose as their own component.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:telegram"
  },
  "quota": {
    "manager": "appmixer:telegram",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "PATCH",
              "DELETE"
            ]
          },
          "parameters": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "headers": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "method"
        ]
      },
      "inspector": {
        "inputs": {
          "url": {
            "type": "text",
            "index": 1,
            "label": "API Endpoint Path",
            "tooltip": "Bot API method name, for example <code>/sendMessage</code> or <code>getChatMemberCount</code>. A full URL is accepted as long as it stays on <code>https://api.telegram.org</code>."
          },
          "method": {
            "type": "select",
            "index": 2,
            "label": "HTTP Method",
            "defaultValue": "GET",
            "tooltip": "Telegram serves every Bot API method over both GET and POST - choose POST whenever there is a request body. PUT, PATCH and DELETE are offered for consistency only; the Bot API does not answer them.",
            "options": [
              {
                "label": "GET",
                "value": "GET"
              },
              {
                "label": "POST",
                "value": "POST"
              },
              {
                "label": "PUT",
                "value": "PUT"
              },
              {
                "label": "PATCH",
                "value": "PATCH"
              },
              {
                "label": "DELETE",
                "value": "DELETE"
              }
            ]
          },
          "parameters": {
            "type": "key-value",
            "index": 3,
            "label": "Query Parameters",
            "keyLabel": "Key",
            "valueLabel": "Value",
            "addLabel": "Add item",
            "removeLabel": "Remove item",
            "tooltip": "Optional query parameters appended to the URL."
          },
          "body": {
            "type": "textarea",
            "index": 4,
            "label": "Request Body",
            "tooltip": "Enter the request body as a JSON object (supports nested objects, arrays, and non-string values)."
          },
          "headers": {
            "type": "key-value",
            "index": 5,
            "label": "Request Headers",
            "keyLabel": "Key",
            "valueLabel": "Value",
            "addLabel": "Add item",
            "removeLabel": "Remove item",
            "tooltip": "Optional additional request headers."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "Status Code",
          "value": "status"
        },
        {
          "label": "Response Headers",
          "value": "headers"
        },
        {
          "label": "Response Body",
          "value": "body",
          "schema": {
            "type": "object",
            "properties": {}
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
