Get sessions by device
Gets the list of sessions from a device.
Gets the list of sessions for the device.
GET
https://api.runonrufus.com/v0/sessions/device/{deviceid}
Path Parameters
Name | Type | Description |
---|---|---|
deviceid* | String | Id of the device to retrieve the sessions from. |
Headers
Name | Type | Description |
---|---|---|
api_key* | String | Account api key with READ or READ_WRITE access type. |
{
"description": "Success",
"result": [
{
"token_session": "2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25",
"alias": "START-5K",
"creation_date": "2023-02-03T15:31:40.000Z",
"active": true,
"passings": 1200
},
{
"token_session": "2A185515C843893A6D5C7783309BBC69294BB886C3E3BC126FECE3904C6E2B25",
"alias": "Intermediate 21K",
"creation_date": "2023-02-03T15:34:17.000Z",
"active": false,
"passings": 550
},
{
"token_session": "6E052EF7876A8998955E846E4F2D365EB017EE46BC13E15E78F8A8493DD8DB4C",
"alias": "FINISH-10K",
"creation_date": "2023-02-03T16:04:26.000Z",
"active": false,
"passings": 10017
}
]
}
{
description: "Sessions not found",
deviceid: "65A1B7E0C6BC3D32C268C1506E3F6F39E225DC6ED79573E177E7243E8E38115B"
}
curl -X GET \
-H "Content-Type: application/json" \
-H "api_key: ror-ae4fc6c19681a20fad30" \
https://api.runonrufus.com/v0/sessions/device/65A1B7E0C6BC3D32C268C1506E3F6F39E225DC6ED79573E177E7243E8E38115B
<?php
$url = "https://api.runonrufus.com/v0/sessions/device/65A1B7E0C6BC3D32C268C1506E3F6F39E225DC6ED79573E177E7243E8E38115B";
$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);
?>
fetch("https://api.runonrufus.com/v0/sessions/device/65A1B7E0C6BC3D32C268C1506E3F6F39E225DC6ED79573E177E7243E8E38115B", {
method: "GET",
headers: {
"Content-Type": "application/json",
"api_key": "ror-ae4fc6c19681a20fad30",
},
})
.then((response) => console.log(response))
.catch((error) => console.error(error));
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/device/65A1B7E0C6BC3D32C268C1506E3F6F39E225DC6ED79573E177E7243E8E38115B",
);
if (response.IsSuccessStatusCode)
{
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
else
{
Console.WriteLine("Error: " + response.StatusCode);
}
}
}
}
Last updated