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
GETrequest to the API endpoint- Set
api_keyquery parameter to a valid Delivery API key. You can create one at Settings → API Keys. - Set
pathquery parameter to the path of the blog you want to get information about. For example, if you want to get information abouthttps://myblog.com/hello-world, setpathto/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
typestringfile or redirectatintegerUNIX timestamp when the object was created
cachebooleanWhether the response object should be cached in proxy/intermediary servers.
false for
post preview routes.statusintegerHTTP status code of the response. Can be
200, 301, 302, or 404.File properties:
Key
Type
Description
file_typestringtemplate, asset, or mediacontentstringBase64 encoded content of the file
mime_typestringMime Type of the file (For Content-Type header)
cache_controlstringHTTP Cache-Control header value
Redirect properties:
Key
Type
Description
tostringURL to redirect to