RUFUS Help
RUFUS Cloud Public API
RUFUS Cloud Public API
  • Introduction to RUFUS Cloud API
  • Getting Started
    • Overview
    • Get your api keys
    • Api permissions
  • TIMING DEVICES
    • Overview
    • Bind a new device
    • Unbind a device
    • Get devices by company
    • Get device information
  • TIMING SESSIONS
    • Overview
    • Insert a new session
    • Close a session
    • Get sessions by device
    • Get active session from device
    • Get session information
  • RACE PASSINGS
    • Overview
    • Insert passings
    • Get session passings by range
    • Get device passings by datetime
Powered by GitBook
On this page
  1. RACE PASSINGS

Insert passings

Insert new race passings into an active timing session.

Inserts a list of race passings into an active timing session.

POST https://api.runonrufus.com/v0/passings

Headers

Name
Type
Description

api_key*

String

Account api key with WRITE or READ_WRITE access type.

Request Body

Name
Type
Description

token_session*

String

Session token identifier.

passings_list*

Array

Array of {passing} objects.

- passing.bib*

String

Bib number.

- passing.num_passing*

Int

Order number of the passing.

- passing.timestamp*

Date

Date object containing the timestamp information of the passing.

Format: YYYY-MM-DDTHH:mm:ss.sssZ

- passing.latitude

String

Latitude coordinate of the passing.

- passing.longitude

String

Longitude coordinate of the passing.

- passing.status

String

Status of the passing.

- passing.participant_id

String

Alternative id field for the passing.

- passing.chips

String

Chip code of the passing.

- passing.timezone

String

Timezone

- passing.gender

String

Alternative gender field for the passing.

{
    "description":"Passings inserted succesfully"
    "token_session":"2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25"
    "inserted_count":10
}

{
    "description":"Session not found or closed"
    "token_session":"2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25"
}
curl -X POST \
-H "Content-Type: application/json" \
-H "api_key: ror-ae4fc6c19681a20fad30" \
-d '{"token_session": "2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25", 
     "passings_list": [
          {
            "bib":"7",
            "num_passing":1,
            "timestamp":"2023-01-22T09:20:25.000Z"
          },
          {
            "bib":"17",
            "num_passing":2,
            "timestamp":"2023-01-22T09:21:33.000Z",
            "timezone":"UTC"
            "latitude":"12.000",
            "longitude":"13.000",
            "status":"Sent",
            "participant_id":"XB123AR8",
            "chip":"000000000000017"
          }
       ]
     }'\
https://api.runonrufus.com/v0/passings
<?php
$url = "https://api.runonrufus.com/v0/passings";

$passings = array(
  array(
      'bib' => '7',
      'num_passing' => 1,
      'timestamp' => '2023-01-22T09:20:25.000Z'
  ),
  array(
      'bib' => '17',
      'num_passing' => 2,
      'timestamp' => '2023-01-22T09:21:33.000Z',
      'timezone' => 'UTC'
      'latitude' => '12.000',
      'longitude' => '13.000',
      'status' => 'Sent',
      'participant_id' => 'XB123AR8',
      'chip' => '000000000000017'
  ),
)
$data = array('token_session' => '2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25', 'passings_list' => array($passings));

$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);
?>
let passings = [
    {
      "bib":"7",
      "num_passing":1,
      "timestamp":"2023-01-22T09:20:25.000Z"
    },
    {
      "bib":"17",
      "num_passing":2,
      "timestamp":"2023-01-22T09:21:33.000Z",
      "timezone":"UTC"
      "latitude":"12.000",
      "longitude":"13.000",
      "status":"Sent",
      "participant_id":"XB123AR8",
      "chip":"000000000000017"
    }
 ]
fetch("https://api.runonrufus.com/v0/passings", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "api_key": "ror-ae4fc6c19681a20fad30",
    },
    body: JSON.stringify({"token_session": "2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25", "passings_list": passings}),
  })
    .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)
        {
            var passings = [
                {
                  "bib":"7",
                  "num_passing":1,
                  "timestamp":"2023-01-22T09:20:25.000Z"
                },
                {
                  "bib":"17",
                  "num_passing":2,
                  "timestamp":"2023-01-22T09:21:33.000Z",
                  "timezone":"UTC"
                  "latitude":"12.000",
                  "longitude":"13.000",
                  "status":"Sent",
                  "participant_id":"XB123AR8",
                  "chip":"000000000000017"
                }
             ];
            var data = {
                  "token_session":"2A19294BB886C3D5C7783309BBC6E385515C843893A6BC126FECE3904C6E2B25",
                  "passings_list":passings
                };

            using var client = new HttpClient();

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

            var response = await client.PostAsync(
                "https://api.runonrufus.com/v0/passings",
                new StringContent(
                    Newtonsoft.Json.JsonConvert.SerializeObject(data),
                    Encoding.UTF8,
                    "application/json"
                )
            );
            
            if (response.IsSuccessStatusCode)
            {
                var result = await response.Content.ReadAsStringAsync();

                Console.WriteLine(result);
            }
            else
            {
                Console.WriteLine("Error: " + response.StatusCode);
            }
        }
    }
}
PreviousOverviewNextGet session passings by range

Last updated 2 years ago