Facebook Pixel

Get Queued Document Addition

Polls the queue for a document addition. Times out after ~50 seconds.

Endpoint

GEThttps://nichesss.com/api/documents/queue/<QUEUE_ID>

Authorization 🔒

Pass your API Key as a Bearer Token.

Request Query Parameters

This endpoint has no request query parameters.

Request Body Parameters

This endpoint has no request body paramters.

Example API calls

Command Line (curl)

curl -H "Authorization: Bearer <YOUR_API_KEY>" -H "Accept: application/json" "https://nichesss.com/api/documents/queue/<QUEUE_ID>"

JavaScript

fetch('https://nichesss.com/api/documents/queue/<QUEUE_ID>', {
    method: 'GET',
    headers: {
        'Content-type': 'application/json',
        'Authorization': 'Bearer <YOUR_API_KEY>', // notice the Bearer before your token
    }
})
.then((response) => response.json())
.then((data) => console.log(data));

Python

import requests

url = 'https://nichesss.com/api/documents/queue/<QUEUE_ID>'
headers = {
    'Content-type': 'application/json',
    'Authorization': 'Bearer <YOUR_API_KEY>',
}

response = requests.get(url, headers=headers)
data = response.json()
print(data)

PHP

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://nichesss.com/api/documents/queue/<QUEUE_ID>');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');

$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'Authorization: Bearer <YOUR_API_KEY>';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);

$data = json_decode($result, true);

print_r($data);

Ruby

require 'net/http'
require 'json'

uri = URI('https://nichesss.com/api/documents/queue/<QUEUE_ID>')

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri)
request['Content-type'] = 'application/json'
request['Authorization'] = 'Bearer <YOUR_API_KEY>'

response = http.request(request)

puts JSON.parse(response.body)

Sample Response

All responses from the API are JSON

{
    "success": true,
    "queue_uri": "https://nichesss.com/api/documents/queue/<QUEUE_ID>",
    "content": [
        {
            "command": "Billy was sitting in his room, sulking. He had been caught sneaking out of the house by his parents and they had given him a stern talking to. They had told him never to leave the house without permission again. Billy knew that they were only trying to protect him, but he thought that they were being too overprotective. He was tired of being treated like a child. He wanted to be able to go out and explore the world on his own.\nBilly's parents had always been overprotective. Even when he was a small child, they had never let him out of their sight. As he got older, they had only become more strict. Billy had always been a rebellious child and he had always tested their rules. But this time, he had gone too far. He knew that they were never going to let him out of the house again.\n Billy was bored. He had been cooped up in the house for days and he was going stir crazy. He was desperate for some fresh air and some freedom. He decided to take matters into his own hands. He was going to sneak out of the house again.\nBilly waited until his parents were asleep before he made his move. He crept out of his bedroom window and climbed down the tree outside. He landed with a soft thud on the ground below. He was free.\nBilly started to walk towards the nearest town. He had never been allowed to go there before and he was excited to explore. He hadn't gone far when he heard a noise behind him. He turned around to see his parents running towards him. They had woken up and realized that he was missing.\nBilly's parents were angry",
            "after": "It was time to call his parents for help."
        }
    ]
}
all endpoints (20)
Documents
Generations
Languages
Tools