The Tearline API reference is organized by resource type. Each resource type has one or more data representations and one or more methods.

METHOD

HTTP REQUEST

DESCRIPTION

get_public_pages GET Returns JSON object containing all public post content. No authentication credentials required.


CODE EXAMPLE: GET PUBLIC POST DATA

#get all public posts
import requests
import re

url = 'https://www.tearline.mil/api/';

method = 'get_public_pages';
    
# call public pages
response = requests.get(url + method);

print( "status: ", response.json()['status'])
print( "count: ", response.json()['count'])
print( "count_total: ", response.json()['count_total'], "n")

for post in response.json()['posts']:
    print( "Post Title: ", post['title'] )
    print( "Post Type: ", post['type'] )
    print( "Post ID: ", post['id'] )

# get all id's of public posts
public_id = [ post['id'] for post in response.json()['posts'] ]