### Getting Started Source: https://fleethunt.readme.io/reference/get_streamax-alarms A guide to help you start using the Fleethunt API quickly, including necessary setup steps. ```APIDOC ## Getting Started To begin using the Fleethunt API, ensure you have a valid API Key. You can obtain this key from your account settings. All requests must be made over HTTPS. ``` -------------------------------- ### Getting Started Source: https://fleethunt.readme.io/reference/get_hos-daily-logs Instructions and steps to begin using the Fleethunt API, including prerequisites and initial setup. ```APIDOC ## **Getting started guide** `List the steps or points required to start using your APIs. Make sure to cover everything required to reach success with your API as quickly as possible.` To start using the Fleethunt API, you need to - - Obtain an API key from your Fleethunt account settings. - Ensure your requests are made over HTTPS. - Understand the API response format (JSON). ``` -------------------------------- ### Get All Drivers PHP Example Source: https://fleethunt.readme.io/reference/drivers PHP script to fetch all drivers from the API. This example uses cURL to send a GET request and retrieve the JSON response. ```php ``` -------------------------------- ### Get All Drivers Node.js Example Source: https://fleethunt.readme.io/reference/drivers Example code for fetching all drivers using Node.js. This snippet assumes a base URL is configured and demonstrates making a GET request to the relevant endpoint. ```javascript const axios = require('axios'); const getDrivers = async () => { try { const response = await axios.get('http://{{baseurl}}/drivers', { headers: { 'accept': 'application/json' } }); return response.data; } catch (error) { console.error('Error fetching drivers:', error); throw error; } }; getDrivers().then(drivers => console.log(drivers)); ``` -------------------------------- ### Install URI Endpoint (Optional) Source: https://fleethunt.readme.io/reference/oauth-technology-partners Implement the install_uri endpoint to handle the initial step of the OAuth flow. Fleethunt will redirect admins to this endpoint when they start the OAuth flow, expecting it to redirect them to Fleethunt's authorize endpoint. ```APIDOC ## GET /fleethunt/oauth/install ### Description This endpoint is part of the OAuth 2.0 installation flow. Fleethunt redirects an admin to this URI when they initiate the app installation process. Your server should then redirect the admin to Fleethunt's authorization endpoint. ### Method GET ### Endpoint /fleethunt/oauth/install ### Parameters #### Query Parameters - **client_id** (string) - Required - The client ID provided by Fleethunt when you registered your OAuth application. - **redirect_uri** (string) - Required - The callback URI registered with Fleethunt where the authorization code will be sent. - **response_type** (string) - Required - Must be set to `code`. - **scope** (string) - Required - Must be set to `public_api`. - **state** (string) - Optional - A value created by your app to maintain state and prevent CSRF attacks. It will be passed back unchanged. ### Request Example ```javascript app.get('/fleethunt/oauth/install', (req, res) => { const fleethuntAuthUrl = 'https://services.fleethunt.ca/v1/oauth/authorize'; const clientId = 'YOUR_CLIENT_ID'; // Replace with your actual client ID const callbackUri = 'https://your.server.com/fleethunt/oauth/callback'; // Replace with your actual redirect URI const state = 'your_generated_state_value'; // Optional: Generate a state value const finalUrl = `${fleethuntAuthUrl}?client_id=${clientId}&redirect_uri=${callbackUri}&response_type=code&scope=public_api&state=${state}`; res.redirect(finalUrl); }); ``` ### Response #### Redirect This endpoint does not return a direct response body. Instead, it performs an HTTP redirect to the Fleethunt authorization URL. #### Success Response (302 Found) - **Location** (string) - The URL to redirect the user to, which is the Fleethunt OAuth authorization endpoint with the necessary query parameters. ### Notes Fleethunt will redirect the admin to the following URL, after receiving a request to your install_uri: `https://services.fleethunt.ca/v1/oauth/authorize?client_id=XXXX&redirect_uri=XXXX&response_type=code&scope=public_api` The approval popup shown to the admin will look similar to: [Image: Fleethunt OAuth Approval Popup] ``` -------------------------------- ### Get All Drivers Ruby Example Source: https://fleethunt.readme.io/reference/drivers Ruby code snippet for retrieving all driver data. It utilizes the 'net/http' library to perform a GET request to the API endpoint. ```ruby require 'net/http' require 'uri' uri = URI.parse('http://{{baseurl}}/drivers') response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http| request = Net::HTTP::Get.new(uri) request['accept'] = 'application/json' http.request(request) end puts response.body ``` -------------------------------- ### Get All Drivers Python Example Source: https://fleethunt.readme.io/reference/drivers Python code for retrieving all driver information using the 'requests' library. It makes a GET request to the specified URL with the appropriate 'accept' header. ```python import requests url = "http://{{baseurl}}/drivers" headers = { 'accept': 'application/json' } try: response = requests.get(url, headers=headers) response.raise_for_status() # Raise an exception for bad status codes drivers = response.json() print(drivers) except requests.exceptions.RequestException as e: print(f"Error fetching drivers: {e}") ``` -------------------------------- ### List All Assets API Endpoint - Node.js Example Source: https://fleethunt.readme.io/reference/assets Example of how to fetch all assets using Node.js. It demonstrates making a GET request to the specified API endpoint with the 'Accept: application/json' header. This snippet is useful for backend JavaScript integrations. ```javascript // Node.js example const https = require('https'); const options = { method: 'GET', hostname: '{{baseurl}}', path: '/assets', headers: { 'accept': 'application/json' } }; const req = https.request(options, function (res) { const chunks = []; res.on('data', function (chunk) { chunks.push(chunk); }); res.on('end', function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); res.on('error', function (error) { console.error(error); }); }); req.end(); ``` -------------------------------- ### Get Evidences API Request (cURL) Source: https://fleethunt.readme.io/reference/dashcams-st-cam-evidences Example cURL command to make a GET request to the 'Get Evidences' API endpoint. It includes the URL and the 'Accept' header. ```Shell curl --request GET \ --url http:///%7Bbaseurl%7D/streamax/evidences \ --header 'accept: application/json' ``` -------------------------------- ### Implement Fleethunt Install URI Endpoint (Javascript) Source: https://fleethunt.readme.io/reference/oauth-technology-partners This Javascript code snippet demonstrates how to implement the install URI endpoint for the Fleethunt OAuth 2.0 flow. It constructs a URL to redirect administrators to Fleethunt's authorization server, including necessary parameters like client ID, callback URI, response type, and scope. This endpoint is the first step in the OAuth installation process initiated from the Fleethunt Dashboard. ```javascript /** * server.js */ ... /** * Endpoint requested by Fleethunt as the first step of the Install flow */ app.get('/fleethunt/oauth/install', (req, res) => { // Fleethunt endpoint that we need to redirect this request to: const fleethuntUrl = BASE_URL; // client_id given by Fleethunt when you registered your app: const clientId = 'YOUR_CLIENT_ID'; // Callback endpoint given to Fleethunt when registering your app (see next step) const callbackUri = 'https://your.server.com/fleethunt/oauth/callback'; // The final url composed of: // - clientId // - callbackUri // - response_type=code // - scope=public_api const finalUrl = fleethuntUrl + '?client_id=' + clientId + '&redirect_uri=' + callbackUri + '&response_type=code' + '&scope=public_api'; // Redirect immediately this request to the finalUrl res.redirect(finalUrl); }); ``` -------------------------------- ### List All Assets API Endpoint - PHP Example Source: https://fleethunt.readme.io/reference/assets A PHP implementation for fetching all assets via the FleetHunt API. This example uses cURL to send a GET request to the assets endpoint, ensuring the 'Accept: application/json' header is included. This is practical for PHP web development. ```php // PHP example $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, "http://{{baseurl}}/assets"); curl_setopt($curl, CURLOPT_HTTPHEADER, array('accept: application/json')); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($curl); curl_close($curl); echo $result; ``` -------------------------------- ### List All Assets API Endpoint - Python Example Source: https://fleethunt.readme.io/reference/assets This Python script demonstrates how to access the List All Assets API endpoint. It uses the 'requests' library to make a GET request, specifying the 'accept' header for JSON output. This is a common approach for Python integrations. ```python # Python example import requests url = "http://{{baseurl}}/assets" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Get All Drivers cURL Request Source: https://fleethunt.readme.io/reference/drivers This cURL command demonstrates how to make a GET request to the 'Get All Drivers' endpoint. It specifies the URL and the 'accept' header for JSON response. ```shell curl --request GET \ --url http:///%7Bbaseurl%7D/drivers \ --header 'accept: application/json' ``` -------------------------------- ### Get Evidences API Request (Python) Source: https://fleethunt.readme.io/reference/dashcams-st-cam-evidences Example Python code snippet to retrieve evidences via the API. It uses the 'requests' library to perform the GET request. The function accepts optional query parameters for customization. ```Python import requests def get_evidences(base_url, params=None): url = f"{base_url}/streamax/evidences" headers = { 'accept': 'application/json' } try: response = requests.get(url, headers=headers, params=params) response.raise_for_status() # Raise an exception for bad status codes return response.json() except requests.exceptions.RequestException as e: print(f"Error fetching evidences: {e}") return None ``` -------------------------------- ### Get Evidences API Request (Ruby) Source: https://fleethunt.readme.io/reference/dashcams-st-cam-evidences Example Ruby code snippet for fetching evidences using the API. It utilizes the 'net/http' library for making HTTP requests and includes headers for the request. The function can be configured with custom parameters. ```Ruby require 'net/http' require 'uri' require 'json' def get_evidences(base_url, params = {}) uri = URI.parse("#{base_url}/streamax/evidences") uri.query = URI.encode_www_form(params) if params http = Net::HTTP.new(uri.host, uri.port) request = Net::HTTP::Get.new(uri.request_uri) request['accept'] = 'application/json' begin response = http.request(request) JSON.parse(response.body) rescue Net::HTTPError => e puts "HTTP Error: #{e.message}" nil rescue JSON::ParserError => e puts "JSON Parsing Error: #{e.message}" nil end end ``` -------------------------------- ### List All Assets API Endpoint - Ruby Example Source: https://fleethunt.readme.io/reference/assets This Ruby code snippet illustrates how to retrieve a list of all assets from the FleetHunt API. It utilizes the 'net/http' library to perform a GET request, setting the necessary headers for a JSON response. This is suitable for Ruby-based applications. ```ruby # Ruby example require 'net/http' require 'uri' uri = URI.parse('http://{{baseurl}}/assets') http = Net::HTTP.new(uri.host, uri.port) request = Net::HTTP::Get.new(uri.request_uri) request['accept'] = 'application/json' response = http.request(request) puts response.body ``` -------------------------------- ### Get Evidences API Request (Node.js) Source: https://fleethunt.readme.io/reference/dashcams-st-cam-evidences Example Node.js code snippet to fetch evidences using the API. This requires the 'axios' library for making HTTP requests. The function takes optional parameters for pagination and filtering. ```JavaScript const axios = require('axios'); async function getEvidences(baseUrl, params) { try { const response = await axios.get(`${baseUrl}/streamax/evidences`, { params: params, headers: { 'accept': 'application/json' } }); return response.data; } catch (error) { console.error('Error fetching evidences:', error); throw error; } } ``` -------------------------------- ### OAuth Redirect API Authorization Request (Ruby) Source: https://fleethunt.readme.io/reference/oauth Example Ruby code to make a GET request to the OAuth Redirect API for authorization using the 'net/http' library. Replace {{baseurl}} with your actual base URL. ```ruby require 'net/http' require 'uri' base_url = 'http://{{baseurl}}' # Replace with your actual base URL client_id = 'YOUR_CLIENT_ID' # Replace with your client ID redirect_uri = 'YOUR_REDIRECT_URI' # Replace with your redirect URI uri = URI.parse("#{base_url}/oauth/authorize") http = Net::HTTP.new(uri.host, uri.port) request = Net::HTTP::Get.new(uri.request_uri) request['accept'] = 'application/json' # Add query parameters request.set_form_data({ 'client_id' => client_id, 'redirect_uri' => redirect_uri, 'response_type' => 'code' }) response = http.request(request) puts "Status: #{response.code}" puts "Body: #{response.body}" # In a real application, you would redirect the user to the authorization URL provided in the response or construct it yourself. ``` -------------------------------- ### OAuth Redirect API Authorization Request (Python) Source: https://fleethunt.readme.io/reference/oauth Example Python code using the 'requests' library to make a GET request to the OAuth Redirect API for authorization. Replace {{baseurl}} with your actual base URL and install the 'requests' library. ```python import requests base_url = 'http://{{baseurl}}' # Replace with your actual base URL client_id = 'YOUR_CLIENT_ID' # Replace with your client ID redirect_uri = 'YOUR_REDIRECT_URI' # Replace with your redirect URI params = { 'client_id': client_id, 'redirect_uri': redirect_uri, 'response_type': 'code' } headers = { 'accept': 'application/json' } try: response = requests.get(f'{base_url}/oauth/authorize', params=params, headers=headers) response.raise_for_status() # Raise an exception for bad status codes print(f"Status Code: {response.status_code}") # The actual redirect would happen in a web framework context. # For demonstration, we'll print the URL the client would be redirected to: redirect_url = response.url print(f"Authorization URL: {redirect_url}") except requests.exceptions.RequestException as e: print(f"Error initiating authorization: {e}") ``` -------------------------------- ### OAuth Redirect API Authorization Request (Node.js) Source: https://fleethunt.readme.io/reference/oauth Example Node.js code to make a GET request to the OAuth Redirect API for authorization. It uses the 'axios' library to handle the HTTP request. Remember to replace {{baseurl}} and install axios. ```javascript const axios = require('axios'); const baseUrl = 'http://{{baseurl}}'; // Replace with your actual base URL const clientId = 'YOUR_CLIENT_ID'; // Replace with your client ID const redirectUri = 'YOUR_REDIRECT_URI'; // Replace with your redirect URI axios.get(`${baseUrl}/oauth/authorize`, { params: { client_id: clientId, redirect_uri: redirectUri, response_type: 'code' }, headers: { 'accept': 'application/json' } }) .then(response => { console.log('Authorization URL:', response.request.res.responseUrl); // The actual redirect will happen in the user's browser }) .catch(error => { console.error('Error initiating authorization:', error); }); ``` -------------------------------- ### Get Organization API Request (Multiple Languages) Source: https://fleethunt.readme.io/reference/organization This section provides examples for retrieving organization data using the FleetHunt API across various programming languages. Each example shows how to construct the GET request to the specified endpoint with the necessary headers. ```shell curl --request GET \ --url http:///%7Bbaseurl%7D/organization \ --header 'accept: application/json' ``` ```node // Node.js example would go here ``` ```ruby # Ruby example would go here ``` ```php // PHP example would go here ``` ```python # Python example would go here ``` -------------------------------- ### Example Device Data Structure Source: https://fleethunt.readme.io/reference/get_locations This JSON structure represents a sample data record for a tracked device. It includes server and device timestamps, geographical coordinates (latitude and longitude), heading, and speed. This format is typical for real-time location tracking. ```json { "server_time": "2024-03-21 22:12:51", "device_time": "2024-03-21 22:12:49", "latitude": 49.72142, "longitude": -94.91087, "heading": 0, "speed": 99 } ``` -------------------------------- ### Get Alarms Python Request Source: https://fleethunt.readme.io/reference/dashcams-st-cam-alarms Example Python request to retrieve alarms using the 'requests' library. It sends a GET request with the specified URL and headers. ```python import requests url = "http://{{baseurl}}/streamax/alarms" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Help and Support Source: https://fleethunt.readme.io/reference/post_v1-oauth-token This section provides resources and contact information for users seeking assistance with the Fleethunt API. It includes links to tutorials, FAQs, and developer forums. ```APIDOC ### **Need some help?** `Add links that customers can refer to whenever they need help.` In case you have questions, go through our tutorials ((link to your video or help documentation here)). Or visit our FAQ page ((link to the relevant page)). Or you can check out our community forum, there’s a good chance our community has an answer for you. Visit our developer forum ((link to developer forum)) to review topics, ask questions, and learn from others. `You can also document or add links to libraries, code examples, and other resources needed to make a request.` ``` -------------------------------- ### Example Device Data Record Source: https://fleethunt.readme.io/reference/get_locations This snippet shows a single record of device data, including server and device timestamps, latitude, longitude, heading, and speed. This format is common for tracking vehicle or asset movements. ```json { "server_time": "2024-03-21 20:00:00", "device_time": "2024-03-21 19:59:59", "latitude": 49.78738, "longitude": -92.83265, "heading": 0, "speed": 3 } ``` -------------------------------- ### Get Alarms PHP Request Source: https://fleethunt.readme.io/reference/dashcams-st-cam-alarms Example PHP request to retrieve alarms using cURL. It configures the cURL request with the GET method, URL, and Accept header. ```php ``` -------------------------------- ### Fleethunt API - Introduction Source: https://fleethunt.readme.io/reference/index This section provides an overview of the Fleethunt API, its capabilities, and general usage guidelines. It covers the RESTful nature of the API, authentication methods (access tokens and OAuth), base URL, and data type conventions. ```APIDOC ## Fleethunt API Overview ### Description Fleethunt provides a RESTful API that allows customers to build applications and custom solutions using Telematics and ELD data. The API enables tracking and analysis of vehicle data, including positions and ELD events for entire fleets. ### Authentication Customers can generate access tokens via the web panel for direct API access. For technology partners building applications for Fleethunt companies, the OAuth flow should be used. ### Base URL All API endpoints can be accessed via HTTP requests to the following base URL: ``` https://services.fleethunt.ca/v1/ ``` ### Date Types - **Timestamps**: All timestamps are in UTC format (YYYY-MM-DD HH:MM:SS). - **Distances**: All distances are measured in Kilometres. ``` -------------------------------- ### Get Alarms Ruby Request Source: https://fleethunt.readme.io/reference/dashcams-st-cam-alarms Example Ruby request to retrieve alarms using the 'Net::HTTP' library. It sets up the connection and sends a GET request with the required headers. ```ruby require 'net/http' require 'uri' uri = URI.parse('http://{{baseurl}}/streamax/alarms') Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http| request = Net::HTTP::Get.new(uri) request['accept'] = 'application/json' response = http.request(request) puts response.body end ``` -------------------------------- ### Example Device Data Structure Source: https://fleethunt.readme.io/reference/get_locations This JSON structure represents a single data point from a vehicle's device. It includes server time, device time, latitude, longitude, heading, and speed. This data is crucial for tracking vehicle location and status. ```json { "server_time": "2024-03-21 14:08:37", "device_time": "2024-03-21 14:08:33", "latitude": 49.19146, "longitude": -88.21695, "heading": 0, "speed": 103 } ``` -------------------------------- ### Get HOS Driver Daily Logs - PHP Request Source: https://fleethunt.readme.io/reference/hours-of-service Example of how to make a GET request to the 'Get HOS Driver Daily Logs' API endpoint using PHP. It utilizes cURL to send an HTTP GET request with the 'accept' header. ```php ``` -------------------------------- ### Get HOS Driver Daily Logs - Ruby Request Source: https://fleethunt.readme.io/reference/hours-of-service Example of how to make a GET request to the 'Get HOS Driver Daily Logs' API endpoint using Ruby. It shows how to construct and send an HTTP GET request with specified headers. ```ruby require 'uri' require 'net/http' url = URI("http://{{baseurl}}/hos/daily/logs") http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Get.new(url) request["accept"] = "application/json" response = http.request(request) puts response.read_body ``` -------------------------------- ### Get HOS Driver Daily Logs - Python Request Source: https://fleethunt.readme.io/reference/hours-of-service Example of how to make a GET request to the 'Get HOS Driver Daily Logs' API endpoint using Python. It uses the 'requests' library to perform an HTTP GET request with the specified header. ```python import requests url = "http://{{baseurl}}/hos/daily/logs" headers = { "accept": "application/json" } response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Fleethunt Driver Object Example (JSON) Source: https://fleethunt.readme.io/reference/get_drivers This snippet shows an example of a driver object in JSON format. It includes fields for user identification, personal details, compliance settings like ELD mode and yard move permissions, and login status. This structure is common for representing driver data. ```json { "id": 3709, "organization_id": 1, "carrier_id": 1, "first_name": "apk2", "last_name": "apk", "mobile_no": 98473435, "email": "dfgfg@fg.ca", "username": "newapk2", "license_no": "98745612", "office_address": "109 Taravista Way NE", "home_address": null, "allow_yard_move": 1, "allow_personal_conveyance": 1, "compliance_mode": "eld", "is_logged_in": 1, "cycle_rule_id": 1, "is_electronic_log_required": 1, "start_time": "00:00:00", "home_terminal_id": 1 } ``` -------------------------------- ### Get HOS Driver Daily Logs - Node.js Request Source: https://fleethunt.readme.io/reference/hours-of-service Example of how to make a GET request to the 'Get HOS Driver Daily Logs' API endpoint using Node.js. It demonstrates making an HTTP request with appropriate headers. ```javascript const options = { method: 'GET', url: 'http://{{baseurl}}/hos/daily/logs', headers: { 'accept': 'application/json' } }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); }); ``` -------------------------------- ### Get HOS Driver Daily Logs - cURL Request Source: https://fleethunt.readme.io/reference/hours-of-service Example of how to make a GET request to the 'Get HOS Driver Daily Logs' API endpoint using cURL. It includes the URL and necessary headers for a successful request. ```shell curl --request GET \ --url http:///%7Bbaseurl%7D/hos/daily/logs \ --header 'accept: application/json' ``` -------------------------------- ### Vehicle Data Object with VIN Source: https://fleethunt.readme.io/reference/get_assets This example demonstrates a vehicle data object where the VIN is provided. It highlights the structure for vehicles with a complete VIN, alongside other identifying and status information. This format is common for vehicles with a registered VIN. ```json { "id": 10, "vehicle_unique_id": "WagonR", "vin": "123", "organization_id": 1, "license_plate_no": null, "is_active": 0, "carrier_id": 1 } ``` -------------------------------- ### List All Groups (JSON Response Example) Source: https://fleethunt.readme.io/reference/assets-groups This is an example JSON response for the 'List All Groups' endpoint. It includes a status code and a list of asset groups, each with an ID and name. The 'status' key indicates success or failure, and 'assetGroups' contains the data. ```json { "status": 0, "assetGroups": [ { "id": 0, "name": "" } ] } ``` -------------------------------- ### Get Evidences API Request (PHP) Source: https://fleethunt.readme.io/reference/dashcams-st-cam-evidences Example PHP code snippet to call the 'Get Evidences' API. This function uses cURL to send a GET request and handles the JSON response. It includes necessary headers and allows for optional query parameters. ```PHP = 200 && $httpCode < 300) { return json_decode($response, true); } else { error_log("Error fetching evidences. HTTP Code: {$httpCode}"); return null; } } ?> ``` -------------------------------- ### Get Alarms cURL Request Source: https://fleethunt.readme.io/reference/dashcams-st-cam-alarms Example cURL request to retrieve alarms from the API. It specifies the HTTP method, URL, and necessary headers. ```shell curl --request GET \ --url http:///%7Bbaseurl%7D/streamax/alarms \ --header 'accept: application/json' ``` -------------------------------- ### Fleethunt Device Data Structure (JSON) Source: https://fleethunt.readme.io/reference/get_locations Example of a single data record from a Fleethunt device. Each record includes server and device timestamps, latitude, longitude, heading, and speed. This format is useful for real-time tracking and historical data analysis. ```json { "server_time": "2024-03-21 14:59:15", "device_time": "2024-03-21 14:58:24", "latitude": 48.72112, "longitude": -88.60769, "heading": 0, "speed": 103 } ``` -------------------------------- ### Get Alarms Node.js Request Source: https://fleethunt.readme.io/reference/dashcams-st-cam-alarms Example Node.js request to retrieve alarms using the 'axios' library. It constructs the request with the appropriate URL and headers. ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'http://{{baseurl}}/streamax/alarms', headers: { 'accept': 'application/json' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### Get Evidences Source: https://fleethunt.readme.io/reference/get_streamax-evidences Retrieves a list of all available evidences. This endpoint can be used to fetch all evidence records associated with a project. ```APIDOC ## GET /evidences ### Description Retrieves a list of all available evidences. This endpoint can be used to fetch all evidence records associated with a project. ### Method GET ### Endpoint /evidences ### Parameters #### Query Parameters - **project_id** (string) - Required - The ID of the project to retrieve evidences for. ### Request Example No request body needed for this GET request. ### Response #### Success Response (200) - **evidences** (array) - A list of evidence objects. - **evidence_id** (string) - The unique identifier for the evidence. - **description** (string) - A brief description of the evidence. - **timestamp** (string) - The date and time when the evidence was recorded. #### Response Example ```json { "evidences": [ { "evidence_id": "evt_12345", "description": "Screenshot of suspicious activity", "timestamp": "2023-10-27T10:30:00Z" }, { "evidence_id": "evt_67890", "description": "Log file analysis report", "timestamp": "2023-10-27T11:00:00Z" } ] } ``` ```