List a Rule by ID
GET https://api.fraudio.com/v1/rules/:rule_id
Endpoint Overview
The "List Rule by ID" endpoint in the Rules Management API allows you to fetch a specific fraud detection rule using its unique identifier. This provides a detailed view of the rule, helping you understand its role and functionality within your organization's fraud prevention setup.
tip
Reach out to our Support Team if you have questions or require further details about this endpoint. We're here to assist.
Request Parameters
Path Parameters
The endpoint requires the following path parameter:
rule_id
: The unique identifier (UUID) of the rule you wish to retrieve.
Example Request With Path Parameter
GET https://api.fraudio.com/v1/rules/123e4567-e89b-12d3-a456-426614174000
Response Parameters
Status Code | Status Message | Description | Schema |
---|---|---|---|
200 | OK | Standard response for successful HTTP requests when fetching a specific rule. | 200 OK - Rule list by ID response |
404 | Not Found | Response when the specified rule ID does not exist. | Problem response |
4xx , 500 , 501 , 502 , 503 , 504 | error | Various error messages for unsuccessful HTTP requests. | Problem response |
Code Samples
- Shell
- Python
- Java
- Perl
- PHP
curl -X GET 'https://api.fraudio.com/v1/rules/YOUR_RULE_ID_HERE' \
-H 'Content-Type: application/json' \
-H "authorization: Bearer $ACCESS_TOKEN"
import os
import requests
rule_id = "YOUR_RULE_ID_HERE" # Replace with your specific rule ID
rules_endpoint = f"https://api.fraudio.com/v1/rules/{rule_id}"
access_token = os.environ["ACCESS_TOKEN"]
headers = {
"authorization": f"Bearer {access_token}",
"Content-Type": "application/json",
}
r = requests.get(rules_endpoint, headers=headers)
print(r.json())
package com.fraudio;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ListRuleById {
public static void main(String[] args) throws IOException, URISyntaxException, InterruptedException {
String ruleId = "YOUR_RULE_ID_HERE"; // Replace with your specific rule ID
String ruleEndpoint = "https://api.fraudio.com/v1/rules/" + ruleId;
String accessToken = System.getenv("ACCESS_TOKEN");
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI(ruleEndpoint))
.header("authorization", String.format("Bearer %s", accessToken))
.header("Content-Type", "application/json")
.GET()
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
String responseBody = response.body();
System.out.println("Response Code: " + response.statusCode() + "\nResponse Body: " + responseBody);
}
}
use LWP::UserAgent;
use HTTP::Request::Common;
my $rule_id = "YOUR_RULE_ID_HERE"; # Replace with your specific rule ID
my $rule_endpoint = 'https://api.fraudio.com/v1/rules/' . $rule_id;
my $access_token = $ENV{"ACCESS_TOKEN"};
my $req = HTTP::Request->new(GET => $rule_endpoint);
$req->header('authorization' => "Bearer $access_token", "Content-Type" => "application/json");
my $ua = LWP::UserAgent->new;
my $resp = $ua->request($req);
my $message = $resp->decoded_content;
print "Received reply: $message";
<?php
$rule_id = "YOUR_RULE_ID_HERE"; // Replace with your specific rule ID
$rule_endpoint = "https://api.fraudio.com/v1/rules/" . $rule_id;
$access_token = $_SERVER["ACCESS_TOKEN"];
$options = [
"http" => [
"header" =>
"authorization: Bearer $access_token\r\n" .
"Content-Type: application/json\r\n",
"method" => "GET"
],
];
$context = stream_context_create($options);
$result = file_get_contents($rule_endpoint, false, $context);
print $result;
?>