Voog API
For domain-independent access, use the Voog Platform API at
https://platform-api.voog.com. Its authentication and supported-resource rules differ from the
site-host API described below.
URI structure
Authentication
Most API requests require an API token. Personal API tokens are generated in the admin
interface ("Account" -> "My profile"). Both personal API tokens and scoped authorization
tokens support the following headers. Prefer Authorization: Bearer <token> for new
integrations. Send only one authentication header per request.
GET /admin/api/languages/1
Authorization: Bearer 8712f9767e6a03ab6c8a80d53fc3ef6e
The X-API-TOKEN header remains supported for compatibility:
GET /admin/api/languages/1
X-API-TOKEN: 8712f9767e6a03ab6c8a80d53fc3ef6e
Without an active CMS session, if both headers are provided, their token values must match.
Different values result in 401 Unauthorized without an error_code or WWW-Authenticate header.
The api_token request parameter [deprecated] remains supported when neither header
provides a token. For example, append
?api_token=8712f9767e6a03ab6c8a80d53fc3ef6e to the request URL. Query parameters are less
secure because URLs can appear in logs and browser history; prefer a header.
An invalid header token results in 401 Unauthorized rather than falling back to the parameter.
An active CMS session takes precedence over API tokens. Token headers and the api_token
parameter are ignored without validation, including conflicting or invalid tokens.
An invalid or expired token returns 401 Unauthorized with error_code: invalid_token.
A valid scoped token that fails the token scope check returns 403 Forbidden with
error_code: insufficient_scope. For these two token errors, Bearer requests also receive a
WWW-Authenticate header identifying the error. Check the token's scopes before retrying an
insufficient_scope response.
Passing the token scope check does not bypass user permissions or endpoint-specific access
rules. Other authorization failures retain their endpoint-specific responses and do not
necessarily include insufficient_scope or a WWW-Authenticate header.
Anonymous access
Some resources allows limited anonymous access (e.g. Article index etc) where API token is not required. If the endpoint allows anonymous access then it's specially marked in API documentation.
Endpoints that support anonymous access:
- Article list
- Article object
- Comments list
- Create comment
- Contents list
- Elements list
- Elements object
- Search
- Tags list
- Tags object
- Download a form attachment
- Ecommerce Carts endpoints
- Ecommerce Invoice object
- Ecommerce Products list
- Ecommerce Product object
- Ecommerce Shipping methods list
- Ecommerce Shipping methods object
Request URI format
The base URI for all API requests is https://example.com/admin/api/.
The next URI segments depend on the type of request made. Most commonly, a resource id is provided within the URI itself. All other data is sent as request data.
All urls respond only to JSON requests and respond with JSON objects.
Request format
Request bodies should be in JSON format and request header have to include Content-Type header:
Content-Type: application/json
Response format
All requests respond with a JSON object. The specific format depends on the request made. For requests that modify or create a resource, a JSON representation of the resource is returned.
Errors
In case of malformed request URIs, missing resources or server-side faults, a relevant HTTP Status Code is provided in the response together with more detailed error messages in a simple JSON format.
Examples:
GET /admin/api/tags/15
Status: 401 Unauthorized
{
"message": "Unauthorized."
}
or
{
"message": "Unauthorized. Not allowed on current subscription level."
}
GET /admin/api/tags/15
Status: 404 Not Found
{
"message": "Not found."
}
PUT /admin/api/tags/15
Status: 400 Bad Request
{
"message": "It's not valid request."
}
PUT /admin/api/tags/15
Status: 422 Unprocessable Entity
{
"message": "Updating of this object was unsuccessful! Please review the fields.",
"errors": {
"title": ["can't be blank"]
}
}
GET - /admin/api/search?q=query
Status: 408 Request Timeout
{
"message": "Request timeout."
}
Filtering and sorting in API
API list actions support filters and sort order parameters. Read more on the API filtering page.
API clients
Ruby client
Ruby client for Voog API is provided as gem.
Install the API gem:
$ gem install voog_api
Read more about using this gem from GitHub.
NodeJS client
NodeJS wrapper for the Voog API is provided as NodeJS module.
Install the API module:
$ npm install voog.js
Read more about using this module from GitHub.