-
Notifications
You must be signed in to change notification settings - Fork 1
API Specification
William Garneau edited this page Sep 26, 2024
·
5 revisions
This document outlines the API specification for the Veri-Fact.ai misinformation detection and mitigation system.
-
Base URL:
https://api.veri-fact.ai/v1 - Authentication: Bearer Token (JWT)
Submit a claim or statement for fact-checking.
-
URL:
/query -
Method:
POST - Auth required: Yes
{
"text": "string",
"context": "string (optional)"
}- Code: 200 OK
- Content example:
{
"id": "string",
"analysis": "string",
"veracity": "true | mostly_true | mixed | mostly_false | false | unverifiable",
"confidence": 0.95,
"sources": [
{
"url": "string",
"title": "string",
"snippet": "string",
"credibilityScore": 0.8
}
]
}Send a message in a chat session.
-
URL:
/chat -
Method:
POST - Auth required: Yes
{
"message": "string",
"sessionId": "string"
}- Code: 200 OK
- Content example:
{
"response": "string",
"analysis": {
// Same structure as Query Response
}
}Retrieve sources for a fact-checked claim.
-
URL:
/sources -
Method:
GET - Auth required: Yes
-
URL Params:
claimId=[string]
- Code: 200 OK
- Content example:
{
"claimId": "string",
"sources": [
{
"url": "string",
"title": "string",
"snippet": "string",
"credibilityScore": 0.8
}
]
}Create a new user account.
-
URL:
/user -
Method:
POST - Auth required: No
{
"username": "string",
"email": "string",
"password": "string"
}- Code: 201 Created
- Content example:
{
"id": "string",
"username": "string",
"email": "string"
}Authenticate a user and receive a JWT token.
-
URL:
/user/login -
Method:
POST - Auth required: No
{
"email": "string",
"password": "string"
}- Code: 200 OK
- Content example:
{
"token": "string",
"user": {
"id": "string",
"username": "string",
"email": "string"
}
}All endpoints can return the following error responses:
- 400 Bad Request: When the request is malformed or missing required fields.
- 401 Unauthorized: When authentication fails or is missing.
Error response body:
{
"code": 400,
"message": "Error description"
}-
text(string, required): The claim or statement to fact-check -
context(string, optional): Additional context for the query
-
url(string): URL of the source -
title(string): Title of the source -
snippet(string): Relevant excerpt from the source -
credibilityScore(float): Credibility rating of the source (0-1)
-
id(string): Unique identifier for the user -
username(string): User's chosen username -
email(string): User's email address
This API uses JWT for authentication. Include the JWT token in the Authorization header of your requests:
Authorization: Bearer <your_token_here>
Obtain a token by using the User Login endpoint.