Delivery API

Delivery API tells you information about how to "serve a request". This API is the backbone of hosting a blog on a subdirectory.

API Endpoint: https://blogs.hyvor.com/api/delivery/v0/{subdomain}

Replace {subdomain} with the subdomain of your blog.

Request

  • GET request to the API endpoint
  • Set api_key query parameter to a valid Delivery API key. You can create one at Settings → API Keys.
  • Set path query parameter to the path of the blog you want to get information about. For example, if you want to get information about https://myblog.com/hello-world, set path to /hello-world/.

Response

A successful response will be one of the following JSON objects:

1. File

This object is returned when the path is a file.

{
    "type": "file",
    "at": 1661590503,
    "cache": true,
    "status": 200,
    "file_type": "template",
    "content": "SGVsbG8gV29ybGQ=",
    "mime_type": "text/html",
    "cache_control": "no-cache, private"
}

2. Redirect

This object is returned when the path is a redirect.

{
    "type": "redirect",
    "at": 1661590503,
    "cache": true,
    "status": 301,
    "to": "https://example.com"
}

Common properties:

Key
Type
Description
type
string
file or redirect
at
integer
UNIX timestamp when the object was created
cache
boolean
Whether the response object should be cached in proxy/intermediary servers. false for post preview routes.
status
integer
HTTP status code of the response. Can be 200, 301, 302, or 404.

File properties:

Key
Type
Description
file_type
string
template, asset, or media
content
string
Base64 encoded content of the file
mime_type
string
Mime Type of the file (For Content-Type header)
cache_control
string
HTTP Cache-Control header value

Redirect properties:

Key
Type
Description
to
string
URL to redirect to