Creates an empty document
Pass your API Key as a Bearer Token.
This endpoint has no request query parameters.
The request body for this endpoint is a JSON payload with the following keys:
Key | Description | Type | Example |
---|---|---|---|
name | Name of documentrequired | String | "Going to the Movies" |
about | Description of the document; what it's about.required | String | "Everything you need to know about going to the movies in 2022" |
Here's an example of the body parameters represented as a JSON object.
{
"name": "Going to the Movies",
"about": "Everything you need to know about going to the movies in 2022"
}
Command Line (curl)
curl -X POST "https://nichesss.com/api/documents" -H "Content-type: application/json" -H "Authorization: Bearer <YOUR_API_KEY>" -d "{\"name\":\"Going to the Movies\",\"about\":\"Everything you need to know about going to the movies in 2022\"}"
JavaScript
fetch('https://nichesss.com/api/documents', {
method: 'POST',
headers: {
'Content-type': 'application/json',
'Authorization': 'Bearer <YOUR_API_KEY>',
},
body: JSON.stringify({"name":"Going to the Movies","about":"Everything you need to know about going to the movies in 2022"})
})
.then((response) => response.json())
.then((data) => console.log(data));
Python
import requests
url = 'https://nichesss.com/api/documents'
payload = {"name":"Going to the Movies","about":"Everything you need to know about going to the movies in 2022"}
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer <YOUR_API_KEY>'}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(data)
PHP
$api_key = '<YOUR_API_KEY>';
$request_url = 'https://nichesss.com/api/documents';
$request_options = array(
'http' => array(
'method' => 'POST',
'header' => 'Content-type: application/json' . "\r\n" .
'Authorization: Bearer ' . $api_key . "\r\n",
'content' => '{"name":"Going to the Movies","about":"Everything you need to know about going to the movies in 2022"}'
)
);
$request_context = stream_context_create($request_options);
$request_result = file_get_contents($request_url, false, $request_context);
$data = json_decode($request_result);
echo $data;
Ruby
require 'net/http'
require 'json'
uri = URI('https://nichesss.com/api/documents')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request['Content-type'] = 'application/json'
request['Authorization'] = 'Bearer <YOUR_API_KEY>'
request.body = {"name":"Going to the Movies","about":"Everything you need to know about going to the movies in 2022"}.to_json
response = http.request(request)
puts JSON.parse(response.body)
All responses from the API are JSON
{
"success": true,
"messsage": "Created your document successfully.",
"id": "DNE92dY5T"
}