# API Connection Sample

To connect to the API through the API documentation interface. You may at first copy the REST API key token from the  [Developer](/personal-account/developer.md) tab.

![](/files/-MC6bpSBDmevYmwDYWkP)

Once this is done you may open in your browser your REST API endpoint and authorize your API using the API key.

![](/files/-MC6bXzt0Us6qMrD1cmC)

{% hint style="warning" %}
Make sure to set the **Bearer** keyword before your API key.
{% endhint %}

Now that you have authorized the API you may try it out using the web based interface, you may for example start by fetching all your surveys using following endpoint.

![](/files/-MC6c8Ldh06hbah8QuCR)


---

# 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.ngsurvey.com/personal-account/developer/api-connection-sample.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.
