-
API v2 Overview
Looking for the APIv2 swagger reference? You can find it in you dashboard in the APIv2 section, or in our full API reference. Note that the reference in the dashboard will always be more accurate to what is available on your site than the full reference. Overview We've rebuilt Vanilla's API from the ground up to enable…
-
APIv2 for Developers
The Vanilla APIv2 Vanilla’s APIv2 offers a powerful, yet simple way of creating RESTful API endpoints in your application. With version 2 of the API we consider Vanilla to be an “API first” framework where you write your API first and then think about the resulting HTML. This offers several benefits: An API is easier to…
-
APIv2 Reference & Endpoints
-
Writing API Endpoints
Controller Endpoints When writing an API controller class, each method represents an endpoint. How to define those endpoint names and parameters is covered in the resource routing guide. This guide concerns writing the contents of a method. The Controller Base Class Although controllers don’t need to inherit from any…
-
Analytics API
/analytics/leaderboard GET /api/v2/analytics/leaderboard HTTP/1.1 Host: https://yoursite.vanillaforums.com Retrieve data for a site leaderboard. Authentication: requireds Parameters Parameter Type Description board string Type of leaderboard start string Start of the time range (ISO 8601). end string End of the time range…
-
Documenting Endpoints
All available API v2 endpoints must appear on the API v2 page in the Vanilla dashboard. Addons augmenting Vanilla’s API v2 capabilities must include valid OpenAPI v3 documentation to describe those changes. Writing a valid OpenAPI v3 endpoint definitions is beyond the scope of this document. If you would like to learn…
-
Authentication With Personal Access Tokens
The API supports two means of authentication. Both require an access token. HTTP Header To authenticate with the HTTP header, pass the access token in the Authorization field with the bearer scheme. Authorization: Bearer <your_access_token> This is the preferred way of authenticating against the API because headers are not…
-
Resource Routing
RESTful Resource Routing to Controller Methods This section tells you how to name your controller objects and methods so that they can be accessed by API requests. By default, all of your controllers are accessed from the /api/v2/ base path. After that, the rest of the path and the HTTP method determines what method gets…
-
API Authentication with JWT
You can use Vanilla's JWT addon to authenticate against the API v2 in addition to the normal web SSO flow. What Is a JWT? JWT stands for JSON Web Token. JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties. In order to use this authentication you will need to…
-
Authenticating API Calls
When making calls to the API you’ll need to pass an access token in order to authenticate as a user. Vanilla has core support for access tokens, with the following features: Access tokens can be issued, verified, and revoked with the AccessTokenModel An access token submitted in the Authorization header will authenticate…