# Make Your First API Call

Let’s make a simple call to fetch the currently authenticated user using your API token. This endpoint requires a valid Bearer token and returns information about your API user.

{% hint style="info" %}
📍 Endpoint: `GET /api/v1/auth`\
🛡 Requires Authentication (Bearer token)
{% endhint %}

## Request Headers

| Header          | Required | Example                 |
| --------------- | -------- | ----------------------- |
| `Authorization` | ✅        | `Bearer YOUR_API_TOKEN` |
| `Accept`        | ✅        | `application/json`      |

## Example Code

{% tabs %}
{% tab title="cUrl" %}

```bash
curl -X GET https://public-api-dev.gurupay.eu/api/v1/auth \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
```

{% endtab %}

{% tab title="PHP" %}

```php
$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://public-api-dev.gurupay.eu/api/v1/auth', [
    'headers' => [
        'Authorization' => 'Bearer YOUR_API_KEY',
        'Accept'        => 'application/json',
    ]
]);

echo $response->getBody();
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
fetch("https://public-api.gurupay.eu/api/v1/auth", {
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json"
  }
})
  .then(response => response.json())
  .then(data => console.log(data));

```

{% endtab %}

{% tab title=".NET" %}

```csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");
        client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

        var response = await client.GetAsync("https://public-api-dev.gurupay.eu/api/v1/auth");
        var content = await response.Content.ReadAsStringAsync();

        Console.WriteLine(content);
    }
}

```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    client := &http.Client{}
    req, err := http.NewRequest("GET", "https://public-api-dev.gurupay.eu/api/v1/auth", nil)
    if err != nil {
        panic(err)
    }

    req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
    req.Header.Add("Accept", "application/json")

    res, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer res.Body.Close()

    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
}

```

{% endtab %}
{% endtabs %}


---

# 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://developers.gurupay.eu/getting-started/make-your-first-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.
