# Get session information

## Gets the details of a single timing session.

<mark style="color:blue;">`GET`</mark> `https://api.runonrufus.com/v0/sessions/{token_session}`

#### Path Parameters

| Name                                             | Type   | Description               |
| ------------------------------------------------ | ------ | ------------------------- |
| token\_session<mark style="color:red;">\*</mark> | String | Session token identifier. |

#### Headers

| Name                                       | Type   | Description                                           |
| ------------------------------------------ | ------ | ----------------------------------------------------- |
| api\_key<mark style="color:red;">\*</mark> | String | Account api key with READ or READ\_WRITE access type. |

{% tabs %}
{% tab title="200: OK Returns the details of the timing session." %}

```javascript
{
  "description": "Success",
  "result": [
    {
      "token_session": "2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25",
      "alias": "START-5K",
      "creation_date": "2023-02-03T15:08:12.000Z",
      "duration": "2023-02-03T17:08:12.000Z",
      "active": true,
      "passings": 31,
      "first": "2023-02-03T16:08:18.263Z",
      "last": "2023-12-22T09:20:25.130Z"
    }
  ]
}
```

{% endtab %}

{% tab title="400: Bad Request If any of the required parameters is missing." %}

{% endtab %}

{% tab title="403: Forbidden If wrong api key access type." %}

{% endtab %}

{% tab title="404: Not Found If session is not found." %}

```javascript
{
    description: "Session not found",
    token_session: "65A1B7E0C6BC3D32C268C1506E3F6F39E225DC6ED79573E177E7243E8E38115B"
}
```

{% endtab %}
{% endtabs %}

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

```sh
curl -X GET \
-H "Content-Type: application/json" \
-H "api_key: ror-ae4fc6c19681a20fad30" \
https://api.runonrufus.com/v0/sessions/2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "https://api.runonrufus.com/v0/sessions/2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25";

$options = array(
    'http' => array(
      'method'  => 'GET',
      'header'=>  "Content-Type: application/json\r\n" .
                  "api_key: ror-ae4fc6c19681a20fad30\r\n" .
                  "Accept: application/json\r\n"
      )
  );
  
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);
$response = json_decode($result);
var_dump($response);
?>
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch("https://api.runonrufus.com/v0/sessions/2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25", {
    method: "GET",
    headers: {
      "Content-Type": "application/json",
      "api_key": "ror-ae4fc6c19681a20fad30",
    },
  })
    .then((response) => console.log(response))
    .catch((error) => console.error(error));
```

{% endtab %}

{% tab title="C#" %}

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

namespace HttpClientExample
{
    class Program
    {
        static async Task Main(string[] args)
        {
            using var client = new HttpClient();

            client.DefaultRequestHeaders.Add("Content-Type", "application/json");
            client.DefaultRequestHeaders.Add("api_key", "ror-ae4fc6c19681a20fad30");

            var response = await client.GetAsync(
                "https://api.runonrufus.com/v0/sessions/2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25",
            );
            
            if (response.IsSuccessStatusCode)
            {
                var result = await response.Content.ReadAsStringAsync();

                Console.WriteLine(result);
            }
            else
            {
                Console.WriteLine("Error: " + response.StatusCode);
            }
        }
    }
}

```

{% endtab %}
{% endtabs %}
