# Making an external API call

We often have the use case where we want to make an API call -- be it to another micro-service in your eco system or to a 3rd party service. Over here we'll see how to accomplish the same in Cosmocloud's Flow Builder.

## Using [API Call](https://docs.cosmocloud.io/flow-builder/node-types/external-nodes/api-call) node

You can use the `API Call` node in the Flow Builder to connect to any external service and hit their API.

<figure><img src="https://392607133-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZCdm9aJ8vkvDIIbg04AL%2Fuploads%2F2N9CNs4VSDwSIoT8Crgt%2FScreenshot%202024-05-06%20at%2012.21.29%E2%80%AFPM.png?alt=media&#x26;token=1833bb1a-c0f4-46be-8843-427b9e3d0227" alt=""><figcaption></figcaption></figure>

You can then open this node's properties and configure your API call you would want to perform. For example, if you want to fetch a list of students from `https://example.com/students` using a `GET` API call, you would configure it as per the below screenshot -

<figure><img src="https://392607133-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZCdm9aJ8vkvDIIbg04AL%2Fuploads%2Fn1upROVoudKEIvS05LJO%2FScreenshot%202024-05-06%20at%2012.22.42%E2%80%AFPM.png?alt=media&#x26;token=8f7944f7-c08c-4416-bfc0-60e6bc2b0203" alt=""><figcaption></figcaption></figure>

This node will return `body` and `statusCode` for you to use in the rest of your flow. For example, if the above `API Call` node has the nodename `node_7`, you can access the response body as `$.node_7.body.<key_in_body>`

You can also make `POST` and other calls, as well as JSON payloads and enable Authentication on this external API.

{% hint style="info" %}
To go deep into `API Call` node's documentation, please [check this link](https://docs.cosmocloud.io/flow-builder/node-types/external-nodes/api-call).
{% 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://docs.cosmocloud.io/examples-how-to/making-an-external-api-call.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.
