From 78de7ed98abff93fe5fef94907bcfa4f76dcef07 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sat, 27 May 2017 10:27:51 -0700 Subject: adding docs to repo --- docs/build/HTTP-APIs/Content/index.html | 1405 +++++++++++++++++++++++++ docs/build/HTTP-APIs/File-Metadata/index.html | 954 +++++++++++++++++ docs/build/HTTP-APIs/Search/index.html | 983 +++++++++++++++++ 3 files changed, 3342 insertions(+) create mode 100644 docs/build/HTTP-APIs/Content/index.html create mode 100644 docs/build/HTTP-APIs/File-Metadata/index.html create mode 100644 docs/build/HTTP-APIs/Search/index.html (limited to 'docs/build/HTTP-APIs') diff --git a/docs/build/HTTP-APIs/Content/index.html b/docs/build/HTTP-APIs/Content/index.html new file mode 100644 index 0000000..4eb39c5 --- /dev/null +++ b/docs/build/HTTP-APIs/Content/index.html @@ -0,0 +1,1405 @@ + + + + + + + + + + + + + + + + + + Content HTTP API + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + + +

Content

+ +

Ponzu provides a read & write HTTP API to access and interact with content on a +system. By default, write access (including create, update and delete) and search +are disabled. See the section on Ponzu's API Interfaces to learn +more about how to enable these endpoints.

+
+

Endpoints

+

Get Content by Type

+

GET /api/content?type=<Type>&id=<ID>

+
Sample Response
+
{
+  "data": [
+    {
+        "uuid": "024a5797-e064-4ee0-abe3-415cb6d3ed18",
+        "id": 6,
+        "slug": "item-id-024a5797-e064-4ee0-abe3-415cb6d3ed18" // customizable
+        "timestamp": 1493926453826, // milliseconds since Unix epoch
+        "updated": 1493926453826,
+        // your content data...,
+    }
+  ]
+}
+
+ + +
+

Get Contents by Type

+

GET /api/contents?type=<Type>

+
    +
  • optional params:
      +
    1. order (string: ASC / DESC, default: DESC)
    2. +
    3. count (int: -1 - N, default: 10, -1 returns all)
    4. +
    5. offset (int: 0 - N, default: 0)
    6. +
    +
  • +
+
Sample Response
+
{
+  "data": [
+    {
+        "uuid": "024a5797-e064-4ee0-abe3-415cb6d3ed18",
+        "id": 6,
+        "slug": "item-id-024a5797-e064-4ee0-abe3-415cb6d3ed18", // customizable
+        "timestamp": 1493926453826, // milliseconds since Unix epoch
+        "updated": 1493926453826,
+        // your content data...,
+    },
+    {
+        "uuid": "5a9177c7-634d-4fb1-88a6-ef6c45de797c",
+        "id": 7,
+        "slug": "item-id-5a9177c7-634d-4fb1-88a6-ef6c45de797c", // customizable
+        "timestamp": 1493926453826, // milliseconds since Unix epoch
+        "updated": 1493926453826,
+        // your content data...,
+    },
+    // more objects...
+  ]
+}
+
+ + +
+

Get Content by Slug

+

GET /api/content?slug=<Slug>

+
Sample Response
+
{
+  "data": [
+    {
+        "uuid": "024a5797-e064-4ee0-abe3-415cb6d3ed18",
+        "id": 6,
+        "slug": "item-id-024a5797-e064-4ee0-abe3-415cb6d3ed18", // customizable
+        "timestamp": 1493926453826, // milliseconds since Unix epoch
+        "updated": 1493926453826,
+        // your content data...,
+    }
+  ]
+}
+
+ + +
+

New Content

+

POST /api/content/create?type=<Type>

+
+

Request Data Encoding

+

Request must be multipart/form-data encoded. If not, a 400 Bad Request +Response will be returned.

+
+
Sample Response
+
{
+  "data": [
+    {
+        "id": 6, // will be omitted if status is pending
+        "type": "Review",
+        "status": "public"
+    }
+  ]
+}
+
+ + +
+

Update Content

+

POST /api/content/update?type=<Type>&id=<id>

+
+

Request Data Encoding

+

Request must be multipart/form-data encoded. If not, a 400 Bad Request +Response will be returned.

+
+
Sample Response
+
{
+  "data": [
+    {
+        "id": 6,
+        "type": "Review",
+        "status": "public"
+    }
+  ]
+}
+
+ + +
+

Delete Content

+

POST /api/content/delete?type=<Type>&id=<id>

+
+

Request Data Encoding

+

Request must be multipart/form-data encoded. If not, a 400 Bad Request +Response will be returned.

+
+
Sample Response
+
{
+  "data": [
+    {
+        "id": 6,
+        "type": "Review",
+        "status": "deleted"
+    }
+  ]
+}
+
+ + +
+

Additional Information

+

All API endpoints are CORS-enabled (can be disabled in configuration at run-time) and API requests are recorded by your system to generate graphs of total requests and unique client requests within the Admin dashboard.

+

Response Headers

+

The following headers are common across all Ponzu API responses. Some of them can be modified +in the system configuration while your system is running.

+
HTTP/1.1
+
HTTP/1.1 200 OK
+Access-Control-Allow-Headers: Accept, Authorization, Content-Type
+Access-Control-Allow-Origin: *
+Cache-Control: max-age=2592000, public
+Content-Encoding: gzip
+Content-Type: application/json
+Etag: MTQ5Mzk0NTYzNQ==
+Vary: Accept-Encoding
+Date: Fri, 05 May 2017 01:15:49 GMT
+Content-Length: 199
+
+ + +
HTTP/2
+
access-control-allow-headers: Accept, Authorization, Content-Type
+access-control-allow-origin: *
+cache-control: max-age=2592000, public
+content-encoding: gzip
+content-length: 199
+content-type: application/json
+date: Fri, 05 May 2017 01:38:11 GMT
+etag: MTQ5Mzk0ODI4MA==
+status: 200
+vary: Accept-Encoding
+
+ + + +

Typewriter +Generate & sync front-end data structures from Ponzu content types. (Ponzu example)

+ + + + + + + +
+
+
+
+ + + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/build/HTTP-APIs/File-Metadata/index.html b/docs/build/HTTP-APIs/File-Metadata/index.html new file mode 100644 index 0000000..ba62cbc --- /dev/null +++ b/docs/build/HTTP-APIs/File-Metadata/index.html @@ -0,0 +1,954 @@ + + + + + + + + + + + + + + + + + + File Metadata HTTP API + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + + +

File Metadata

+ +

Ponzu provides a read-only HTTP API to get metadata about the files that have been uploaded to your system. As a security and bandwidth abuse precaution, the API is only queryable by "slug" which is the normalized filename of the uploaded file.

+
+

Endpoints

+

Get File by Slug (single item)

+

GET /api/uploads?slug=<Slug>

+
Sample Response
+
{
+  "data": [
+    {
+        "uuid": "024a5797-e064-4ee0-abe3-415cb6d3ed18",
+        "id": 6,
+        "slug": "filename.jpg",
+        "timestamp": 1493926453826, // milliseconds since Unix epoch
+        "updated": 1493926453826,
+        "name": "filename.jpg",
+        "path": "/api/uploads/2017/05/filename.jpg",
+        "content_length": 357557,
+        "content_type": "image/jpeg",
+    }
+  ]
+}
+
+ + + + + + + +
+
+
+
+ + + + +
+ + + + + + + + + + + + \ No newline at end of file diff --git a/docs/build/HTTP-APIs/Search/index.html b/docs/build/HTTP-APIs/Search/index.html new file mode 100644 index 0000000..45c41f2 --- /dev/null +++ b/docs/build/HTTP-APIs/Search/index.html @@ -0,0 +1,983 @@ + + + + + + + + + + + + + + + + + + Full-text Search HTTP API + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + + +

Search

+ +

Ponzu provides a read-only HTTP API to search the contents of your system's database. +Full-text search is made possible by the use of Bleve, +which handles the indexing and querying.

+
+

Endpoints

+

Search Content

+

GET /api/search?type=<Type>&q=<Query String>

+
+

Search must be enabled individually for each Content type

+
    +
  • Search is not on by default to protect your data in case it shouldn't be indexed and published via the API.
  • +
  • SearchMapping() is implemented with default mapping (ideal for 99% of use cases).
  • +
  • To enable search, add a IndexContent() bool method to your content type and return true (default implementation returns false).
  • +
+
+
    +
  • +

    <Type> must implement db.Searchable

    +
  • +
  • +

    Search is currently limited to single <Type> per request

    +
  • +
  • +

    <Query String> documentation here: Bleve Docs - Query String

    +
  • +
  • +

    Search results are formatted exactly the same as standard Content API calls, so you don't need to change your client data model

    +
  • +
  • +

    Search handler will respect other interface implementations on your content, including:

    + +
  • +
+
Sample Response
+
{
+  "data": [
+    {
+        "uuid": "024a5797-e064-4ee0-abe3-415cb6d3ed18",
+        "id": 6,
+        "slug": "item-id-024a5797-e064-4ee0-abe3-415cb6d3ed18", // customizable
+        "timestamp": 1493926453826, // milliseconds since Unix epoch
+        "updated": 1493926453826,
+        // your content data...,
+    }
+  ]
+}
+
+ + + + + + + +
+
+
+
+ + + + +
+ + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3