Get one training
curl --request GET \
--url http://localhost:3000/rs/trainings/v1/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:3000/rs/trainings/v1/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:3000/rs/trainings/v1/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/rs/trainings/v1/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/rs/trainings/v1/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:3000/rs/trainings/v1/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/rs/trainings/v1/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ref": "<string>",
"type": "preventive",
"status": "draft",
"title": "<string>",
"description": "<string>",
"autoCreated": true,
"creationStatus": "scheduled",
"isPlanned": true,
"scheduledStart": "2023-11-07T05:31:56Z",
"scheduledEnd": "2023-11-07T05:31:56Z",
"actualStart": "2023-11-07T05:31:56Z",
"actualEnd": "2023-11-07T05:31:56Z",
"verifiedAt": "2023-11-07T05:31:56Z",
"verifiedByUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assignedContactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assignedUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"historizedAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attendeeCount": 4503599627370495,
"trainingProof": {
"name": "<string>",
"mimeType": "<string>",
"size": 536870912,
"downloadUrl": "<string>"
},
"trainedUsers": [
{
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attendanceStatus": "present",
"attendanceProof": {
"name": "<string>",
"mimeType": "<string>",
"size": 536870912,
"downloadUrl": "<string>"
},
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
}
],
"trainedUsersCount": 4503599627370495,
"assignedUser": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"assignedContact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"createdBy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"units": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ref": "<string>",
"name": "<string>"
}
],
"actions": {
"canBeUpdated": true,
"canBeArchived": true,
"canBeUnarchived": true,
"canBeDeleted": true
},
"rule": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"rrule": "<string>"
},
"rules": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"rrule": "<string>"
}
],
"rulesCount": 4503599627370495,
"_count": {
"comments": 4503599627370495,
"attachments": 4503599627370495
},
"verifiedBy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
}{
"error": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": "<unknown>"
}trainings
Get one training
GET
/
rs
/
trainings
/
v1
/
{id}
Get one training
curl --request GET \
--url http://localhost:3000/rs/trainings/v1/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:3000/rs/trainings/v1/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:3000/rs/trainings/v1/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3000",
CURLOPT_URL => "http://localhost:3000/rs/trainings/v1/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:3000/rs/trainings/v1/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:3000/rs/trainings/v1/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/rs/trainings/v1/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ref": "<string>",
"type": "preventive",
"status": "draft",
"title": "<string>",
"description": "<string>",
"autoCreated": true,
"creationStatus": "scheduled",
"isPlanned": true,
"scheduledStart": "2023-11-07T05:31:56Z",
"scheduledEnd": "2023-11-07T05:31:56Z",
"actualStart": "2023-11-07T05:31:56Z",
"actualEnd": "2023-11-07T05:31:56Z",
"verifiedAt": "2023-11-07T05:31:56Z",
"verifiedByUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assignedContactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assignedUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"historizedAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attendeeCount": 4503599627370495,
"trainingProof": {
"name": "<string>",
"mimeType": "<string>",
"size": 536870912,
"downloadUrl": "<string>"
},
"trainedUsers": [
{
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attendanceStatus": "present",
"attendanceProof": {
"name": "<string>",
"mimeType": "<string>",
"size": 536870912,
"downloadUrl": "<string>"
},
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
}
],
"trainedUsersCount": 4503599627370495,
"assignedUser": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"assignedContact": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"createdBy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"units": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ref": "<string>",
"name": "<string>"
}
],
"actions": {
"canBeUpdated": true,
"canBeArchived": true,
"canBeUnarchived": true,
"canBeDeleted": true
},
"rule": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"rrule": "<string>"
},
"rules": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"rrule": "<string>"
}
],
"rulesCount": 4503599627370495,
"_count": {
"comments": 4503599627370495,
"attachments": 4503599627370495
},
"verifiedBy": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
}{
"error": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": "<unknown>"
}{
"error": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": "<unknown>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Query Parameters
Extend options (JSON-encoded array, e.g. ?extend=["category"]):
- "trained-users": Named attendance roster (user id/name + status + proof) and count.
- "assigned-to": Resolves the assigned user (via identity) or provider contact (id, name).
- "created-by": Resolves the creator as
createdBy(id, name). - "units": Resolves every unit the training concerns - through its compliances, its anomalies, or the units and equipments it directly targets.
- "actions-info": Adds
actions{ canBeUpdated, canBeArchived, canBeUnarchived, canBeDeleted }. - "rules": Adds the rules the training answers for, deduplicated (
rulewhen exactly one,ruleslist,rulesCount), each with itsrruleperiodicity. - "counts": Adds
_countof the linked comments and attachments. - "verification": Resolves the verifying user as
verifiedBy(id, name);verifiedAtis in the default shape.
Available options:
trained-users, assigned-to, created-by, units, actions-info, rules, counts, verification Response
Default Response
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Maximum string length:
40Pattern:
^[A-Z]+-[1-9]\d*(?:-[A-Z]+-[1-9]\d*)*$Available options:
preventive, curative, troubleshooting, audit, exercise, session, qualification Available options:
draft, to_be_scheduled, scheduling_in_progress, scheduled, in_progress, awaiting_report, awaiting_proof, awaiting_validation, validated, rejected Required string length:
1 - 200Maximum string length:
2000Available options:
scheduled, done Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Required range:
0 <= x <= 9007199254740991Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
0 <= x <= 9007199254740991Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Required range:
0 <= x <= 9007199254740991Show child attributes
Show child attributes
Show child attributes
Show child attributes