Docs REST API
OpenAPI and Postman
Get the OpenAPI spec and the Postman collection of the API, and import them in Postman, Insomnia or Bruno.
The API has an OpenAPI 3.1 spec and a Postman collection. Both cover the REST API (/api/public/v1) and the widget init call (/api/v1/init).
Where the files are
The app repository has the files in docs/api/:
| File | What it holds |
|---|---|
docs/api/openapi.yaml |
The OpenAPI 3.1 spec. The maintainers write it by hand. |
docs/api/postman_collection.json |
The Postman collection (v2.1), made from the spec. |
docs/api/postman_environment.json |
A Postman environment with placeholder values. |
Each instance also serves the files on the dashboard host. You do not need an account to get them.
| Path | What it returns |
|---|---|
/documentation/reference |
The API reference as a web page, with request examples. |
/documentation/openapi.json |
The spec as JSON. |
/documentation/openapi/download |
The spec as a file download. |
/documentation/postman/download |
The Postman collection as a file download. |
The Settings > API Tokens page also has a link to the Postman collection.
The keys in the spec
Each operation of the spec names the key that it needs:
| Security scheme | Key | Operations |
|---|---|---|
apiToken |
An API token. Read Authentication. | All operations of /api/public/v1 |
publishableKey |
The publishable key of the project. Read Widget init. | POST /api/v1/init only |
The server URL of the spec is the {baseUrl} variable. Set it to the URL of your instance, for example https://feedback.example.com. The paths of the spec start with /api/.
The variables
The collection and the environment use these variables:
| Variable | Set it to |
|---|---|
baseUrl |
The URL of your instance, with no slash at the end, for example https://feedback.example.com. |
token |
Your API token. All requests send it, except the widget init request. |
publishableKey |
The publishable key of the project. Only the widget init request sends it. |
The environment file has placeholder values only. Replace them before you send a request.
Import in Postman
- In Postman, click Import.
- Select
postman_collection.json. - Click Import again, and select
postman_environment.json. - Open the environment Feedback Pilgrim.
- Set
baseUrl,tokenandpublishableKey. - Select the environment in the environment menu.
The collection has one folder for each tag of the spec: Init, Widget, Posts, Release Notes, Contacts, Testimonials and Tags. The optional query parameters are off. Turn on the parameters that you need.
Import in Insomnia
- In Insomnia, click Import.
- Select
postman_collection.jsonoropenapi.yaml. Insomnia reads both formats. - Open the environment of the new collection.
- Set
baseUrlandtoken.
Import in Bruno
- In Bruno, click Import Collection.
- Select Postman Collection and the file
postman_collection.json. You can also select OpenAPI V3 Spec and the fileopenapi.yaml. - Select a folder for the collection.
- Make an environment with the variables
baseUrlandtoken.
Keep the files current
If you change the API of the app, read CONTRIBUTING.md of the app. In short:
- Change
docs/api/openapi.yaml. - Run
composer api-docs. The script makes the JSON copy of the spec and the Postman files again. - Commit all the files together.
The CI of the app fails when the generated files do not match the spec. A test of the app fails when an API route has no operation in the spec, or when an operation has no route.