Insert a new session
Insert a new timing session into a device.
Inserts a new and active timing session in the given device and returns the token_session.
Headers
Name
Type
Description
Request Body
Name
Type
Description
{
"description":"Session inserted succesfully"
"token_session":"2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25"
}{
description: "Device not found",
deviceid: "65A1B7E0C6BC3D32C268C1506E3F6F39E225DC6ED79573E177E7243E8E38115B",
}curl -X POST \
-H "Content-Type: application/json" \
-H "api_key: ror-ae4fc6c19681a20fad30" \
-d '{"deviceid": "65A1B7E0C6BC3D32C268C1506E3F6F39E225DC6ED79573E177E7243E8E38115B", "alias": "START-5K"}' \
https://api.runonrufus.com/v0/sessions
<?php
$url = "https://api.runonrufus.com/v0/sessions";
$data = array('deviceid' => '65A1B7E0C6BC3D32C268C1506E3F6F39E225DC6ED79573E177E7243E8E38115B', 'alias' => 'START-5K');
$options = array(
'http' => array(
'method' => 'POST',
'content' => json_encode($data),
'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);
?>Last updated