FusionCMS is currently in an open beta state and under heavy active development.

API

Requirements

The FusionCMS API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Authentication

At this time, the FusionCMS API uses personal access tokens to authenticate requests. You can view and manage your API keys on your account page after enabling personal access tokens in the control panel. Once a token has been generated, it must be included with every request, and should be delivered in a HTTP header:

Authorization: Bearer <Personal Access Token>

Errors

FusionCMS' API uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, etc.), and codes in the 5xx range indicate an error at the server level.

All error responses will be returned within an error array of your request. Error responses will include the following information:

  • Status Code
  • Message

Here's an example of a returned 404 response:

{
    "error": [
        "message": "Category not found.",
        "status_code": 404
    ]
}

Pagination

Requests that return multiple items will be paginated to 30 items by default. You can specify further pages with the ?page parameter. You may also set a custom page size up to 100 with the ?per_page parameter. Page numbering is 1-based, where omitting the ?page parameter will return the first page.


Endpoints

For the remainder of this documentation, we'll discuss each endpoint available through the API.

List Fieldtypes

GET
/api/fieldtypes

Sample Response

Get Fieldtype

GET
/api/fieldtypes/{slug}

Sample Response

List Forms

GET
/api/forms

Sample Response

Get Form

GET
/api/forms/{id}

Sample Response

Update Form

PATCH
/api/forms/{id}

Sample Response

Delete Form

DELETE
/api/forms/{id}

Sample Response

Create Form

POST
/api/forms

Sample Response

List Activity

GET
/api/activity

Sample Response

List Backups

GET
/api/backups

Sample Response

Create Backup

POST
/api/backups

Sample Response

Delete Backup

DELETE
/api/backups/{backup}

Sample Response

Restore Backup

POST
/api/backups/restore/{backup}

Sample Response

Upload Backup

POST
/api/backups/upload

Sample Response

List All Responses

GET
/api/forms/responses

Returns a list of all responses across all forms.

Sample Response

List Form Responses

GET
/api/forms/{slug}/responses

Lists the responses for the given form.

Sample Response

Have questions?

We're always happy to help with code or other questions you might have. Contact support or chat live with us on Discord.

Last edited on Monday, March 23, 2020 (4 years ago)