import os
import requests
url = (
"https://api.ferretly.com"
"/api/Subjects"
)
key = os.getenv("FERRETLY_API_KEY")
subject = {
"name": "John Doe",
"city": "Anytown",
"state": "CA",
}
response = requests.post(
url,
headers={"X-Api-Key": key},
json={"subjectData": subject},
)
print(response.json())
const url =
"https://api.ferretly.com" +
"/api/Subjects";
const key = process.env.FERRETLY_API_KEY;
const response = await fetch(url, {
method: "POST",
headers: { "X-Api-Key": key },
body: JSON.stringify({
subjectData: {
name: "John Doe",
city: "Anytown",
state: "CA",
},
}),
});
console.log(await response.json());
var client = new HttpClient();
var key = Environment
.GetEnvironmentVariable(
"FERRETLY_API_KEY");
client.DefaultRequestHeaders.Add(
"X-Api-Key", key);
var url =
"https://api.ferretly.com"
+ "/api/Subjects";
var response = await client
.PostAsJsonAsync(url, new {
subjectData = new {
name = "John Doe",
city = "Anytown",
state = "CA",
}
});
curl --request POST \
--header "X-Api-Key: $FERRETLY_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"subjectData": {
"name": "John Doe",
"city": "Anytown",
"state": "CA"
}
}' \
https://api.ferretly.com/api/Subjects