Retrieve the results of a previously submitted decision by its ID.
Parameters
decision_id: str
The decision ID to retrieve
Returns
Get decision results
import os
from safetykit import Safetykit
client = Safetykit(
api_key=os.environ.get("SAFETYKIT_API_KEY"), # This is the default and can be omitted
)
decision = client.decisions.get(
"decision_id",
)
print(decision.decision_id)
{
"decision_id": "content_01h2m7qdmdjckc30e1mnq6xqfd",
"decision_status": "SUCCESS",
"labels": [
{
"applied": true,
"explanation": "The product is stated to be a Burberry item, a well-known brand",
"name": "Counterfeit brands"
},
{
"applied": false,
"explanation": "The product is a handbag, and does not contain any illegal drugs",
"name": "Illegal drugs"
}
],
"metadata": {},
"result": "violating",
"policy_id": "policy_id",
"policy_version": "policy_version"
}
Returns Examples
{
"decision_id": "content_01h2m7qdmdjckc30e1mnq6xqfd",
"decision_status": "SUCCESS",
"labels": [
{
"applied": true,
"explanation": "The product is stated to be a Burberry item, a well-known brand",
"name": "Counterfeit brands"
},
{
"applied": false,
"explanation": "The product is a handbag, and does not contain any illegal drugs",
"name": "Illegal drugs"
}
],
"metadata": {},
"result": "violating",
"policy_id": "policy_id",
"policy_version": "policy_version"
}