API Reference
Notes
Create a note
Attach a new note to a contact.
Body parameters
| Name | Type | Description |
|---|---|---|
title |
string | Required. Short title |
body |
string | Note text (Markdown allowed) |
userId |
integer | Required. Author's user ID |
Returns the created note with its new id.
curl -X POST "https://jsonplaceholder.typicode.com/posts" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"title": "Call back on Friday",
"body": "Wants a demo of the reporting module.",
"userId": 1
}'
const res = await fetch("https://jsonplaceholder.typicode.com/posts", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({
"title": "Call back on Friday",
"body": "Wants a demo of the reporting module.",
"userId": 1
})
});
const data = await res.json();
console.log(data);
<?php
$ch = curl_init("https://jsonplaceholder.typicode.com/posts");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"Accept: application/json",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{
"title": "Call back on Friday",
"body": "Wants a demo of the reporting module.",
"userId": 1
}',
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
print_r($data);
import requests
payload = '''{
"title": "Call back on Friday",
"body": "Wants a demo of the reporting module.",
"userId": 1
}'''
res = requests.request(
"POST",
"https://jsonplaceholder.typicode.com/posts",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
"Content-Type": "application/json",
},
data=payload,
)
print(res.json())
Example response
{
"id": 101,
"title": "Call back on Friday",
"body": "Wants a demo of the reporting module.",
"userId": 1
}
API playground
Requests are sent directly from your browser (the API must allow CORS).