CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 239
API
The read-only API is available starting from version 4 of cState. You can read about v4's API (which is version 1.0.0).
This page is about the latest version of the API, v2.0, for cState v5.
- Information is delivered in JSON (RFC 4627).
- All links will end in
/index.json
. - The Content-Type header is:
application/json; charset=utf-8
. - The output may not always be clean (some empty lines, commas in weird places, and so forth). This is because the JSON is generated similarly to a HTML page, however. At the time of writing, there is no obvious fix to this problem.
- The status will basically always respond with 200 - OK.
- Because cState is static, the only error code it can really respond with is 404 - Not Found. If there is an error or mistake in the final JSON, the site will likely just not build, or the value will be
<no value>
, etc.
- Because cState is static, the only error code it can really respond with is 404 - Not Found. If there is an error or mistake in the final JSON, the site will likely just not build, or the value will be
- Please report bugs, if you catch them!
- example.com/index.json (homepage) now shows a system's status and system's unresolvedIssues
- for all issues (is: issue) the informational variable is now a boolean true/false. no more
- likewise, the resolved variable is no longer a string surrounded by "", but an actual boolean
- added lastmod to issues
- there is generally less whitespace
- added custom tab links to homepage index.json
- reordered to have more important info up top
Along with the release of v2, by default, there should be no more CORS issues (meaning the API is fully usable on other sites and domains).
Add this to your netlify.toml for your site if you don't have it already:
[[headers]]
for = "/*.json"
[headers.values]
Access-Control-Allow-Origin = "*"
Docs: https://docs.netlify.com/routing/headers/#multi-value-headers
- The homepage URL +
/index.json
- specific page
- lists
* Getting meta information about the website (basic, meta, versions, etc) * Summary of the status and status for each component/system
E.g.: https://cstate.mnts.lt/index.json
* Getting content and characteristics of a static page (issue or simple page)
Add /index.json
to the end of the URL. For example, if you have a permalink like this: https://localhost:1313/issues/2018-05-25-us-east-conn-issues/
it’ll be https://localhost:1313/issues/2018-05-25-us-east-conn-issues/index.json
.
You will then be shown the .Content
and essential frontmatter information.
Link of the page + /index.json
E.g. with page: https://cstate.mnts.lt/pages/example-page/index.json
E.g. with issue: https://cstate.mnts.lt/issues/2018-05-25-us-east-conn-issues/index.json
* Getting a list of a certain type of pages
Homepage URL + /<LIST>/index.json
Still can’t find help? Open issue →
Like cState? Please star it and share it with people who might find it useful!
Use the README to get some basic information about cState.
- cState Core (you are here)
- cState HTML Embed
- cState CLI
- cState Monitor Bot
Please note the Monitor Bot and CLI tools work best with cState version 6 and up.
- Method 1 - Create a new file manually
- Method 2 - Create incident with CLI / SSH
- Method 3 – Create incident from Web UI
Create incidents automatically – Setting up monitoring
Announcing maintenance. Informational posts (pinned or not) [v5.2+]
- Changing site name
- Changing site URL
- Changing site language
- Changing site description
- Changing date formats (v3.0)
- Tabs
- Google Analytics
- Disable complex calculations (v4.1)
- Hiding incident history (v4.2)
- Customize incident history display (v6)
- Uptime histogram (v6)