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.
Request Headers
Header
Required
Example
Authorization
✅
Bearer YOUR_API_TOKEN
Accept
✅
application/json
Example Code
curl -X GET https://public-api-dev.gurupay.eu/api/v1/auth \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"$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();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));
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);
}
}
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))
}
Last updated
Was this helpful?
