Class Add
Adds a class to a repository.
URL
POST https://api.synodic.ai/v0/{user}/{repo}/class/add
Headers
- x-api-key:
YOUR_API_KEY
(string)
Path Parameters
- {user}: username (string)
- {repo}: repository name (string)
Body
- class: class name (string)
Example Request
- Bash
- Python
- Node.js
- Rust
curl -X POST "https://api.synodic.ai/v0/{user}/{repo}/class/add" -H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{"class": "class_name"}'
import requests
headers = {
"x-api-key": "YOUR_API_KEY"
}
response = requests.post("https://api.synodic.ai/v0/{user}/{repo}/class/add", headers=headers, json={"class": "class_name"})
print(response.json())
const axios = require('axios');
const headers = {
"x-api-key": "YOUR_API_KEY"
};
axios.post("https://api.synodic.ai/v0/{user}/{repo}/class/add", { class: "class_name" }, { headers })
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
use reqwest;
fn main() {
let client = reqwest::blocking::Client::new();
let response = client.post("https://api.synodic.ai/v0/{user}/{repo}/class/add")
.header("x-api-key", "YOUR_API_KEY")
.json(&serde_json::json!({ "class": "class_name" }))
.send()
.expect("Failed to send request");
println!("{:?}", response.text());
}
Example Response
{
"classes": [
"Existing Class 0",
"Existing Class 1",
"New Class"
]
}