policies_all_test_create
POST/api/v3//policies/all/:policy_uuid/test/
Test policy
Request
Path Parameters
policy_uuid uuidrequired
A UUID string identifying this Policy.
- application/json
Bodyrequired
userintegerrequired
context object
Responses
- 200
- 400
- 403
- application/json
- Schema
- Example (auto)
Schema
passingbooleanrequired
messagesstring[]required
log_messages object[]required
{
"passing": true,
"messages": [
"string"
],
"log_messages": [
{
"timestamp": "2024-07-29T15:51:28.071Z",
"log_level": "critical",
"logger": "string",
"event": "string",
"attributes": {}
}
]
}
Invalid parameters
- application/json
- Schema
- Example (auto)
Schema
detailstringrequired
codestring
{
"detail": "string",
"code": "string"
}
Authorization: http
name: authentiktype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "/api/v3/policies/all/:policy_uuid/test/");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"user\": 0,\n \"context\": {}\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());