diff --git a/server/pages/Api.js b/server/pages/Api.js index c30430097..063aa9dab 100644 --- a/server/pages/Api.js +++ b/server/pages/Api.js @@ -4,12 +4,9 @@ import Grid from 'styled-components-grid'; import { Helmet } from 'react-helmet'; import styled from 'styled-components'; import Header from './components/Header'; +import Content from './components/Content'; const Container = styled.div` - max-width: 720px; - margin: 0 auto; - padding: 0 2em; - pre { padding: 0.5em 1em; background: #f9fbfc; @@ -49,7 +46,11 @@ const Container = styled.div` h3 { code { - font-size: 1.08em; + font-size: 1em; + padding: 2px 4px; + background: #333; + border-radius: 4px; + color: #fff; } } `; @@ -64,612 +65,665 @@ export default function Pricing() {
Outline is built on an open, best-in-class, API
-- As developers, it’s our mission to make the API as great as possible. - While Outline is still in public beta, we might make small - adjustments, including breaking changes to the API. -
-
- Outline’s API follows simple RPC style conventions where each API
- endpoint is a method on{' '}
- https://www.getoutline.com/api/<METHOD>. Both{' '}
- GET and POST methods are supported but it’s
- recommeded that you make all call using POST. Only HTTPS
- is supported in production.
-
+ As developers, it’s our mission to make the API as great as + possible. While Outline is still in public beta, we might make + small adjustments, including breaking changes to the API. +
-
- For GET requests query string parameters are expected
- (e.g.
- /api/document.info?id=...&token=...). When making{' '}
- POST requests, request parameters are parsed depending on{' '}
- Content-Type header. To make a call using JSON payload,
- one must pass Content-Type: application/json header:
-
+ Outline’s API follows simple RPC style conventions where each
+ API endpoint is a method on{' '}
+ https://www.getoutline.com/api/<METHOD>. Both{' '}
+ GET and POST methods are supported but
+ it’s recommeded that you make all call using POST.
+ Only HTTPS is supported in production.
+
- Example POST request: -
-
-
- {`curl https://www.getoutline.com/api/documents.info
+
+ For GET requests query string parameters are
+ expected (e.g.
+ /api/document.info?id=...&token=...). When making{' '}
+ POST requests, request parameters are parsed
+ depending on Content-Type header. To make a call
+ using JSON payload, one must pass{' '}
+ Content-Type: application/json header:
+
+
+
+ Example POST request:
+
+
+
+ {`curl https://www.getoutline.com/api/documents.info
-X POST
-H 'authorization: Bearer API_KEY'
-H 'content-type: application/json'
-H 'accept: application/json'
-d '{"id": "outline-api-NTpezNwhUP"}'
`}
-
-
+
+
- - Example GET request: -
-
-
- {`curl https://www.getoutline.com/api/documents.info?id=outline-api-NTpezNwhUP&token=API_KEY
+
+ Example GET request:
+
+
+
+ {`curl https://www.getoutline.com/api/documents.info?id=outline-api-NTpezNwhUP&token=API_KEY
`}
-
-
+
+
- - To access private API endpoints, you must provide a valid API key. You - can create new API keys in your{' '} - account settings. Be - careful when handling your keys as they give access to all of your - documents. -
++ To access private API endpoints, you must provide a valid API + key. You can create new API keys in your{' '} + account settings. Be + careful when handling your keys as they give access to all of + your documents. +
-
- To authenticate with Outline API, you can supply the API key as a
- header (Authorization: Bearer YOUR_API_KEY) or as part of
- the payload using token parameter. If you’re making{' '}
- GET requests, header based authentication is recommended
- so that your keys don’t leak into logs.
-
+ To authenticate with Outline API, you can supply the API key as
+ a header (Authorization: Bearer YOUR_API_KEY) or as
+ part of the payload using token parameter. If
+ you’re making GET requests, header based
+ authentication is recommended so that your keys don’t leak into
+ logs.
+
- Some API endpoints allow unauhenticated requests for public resources - and they can be called without an API key. -
++ Some API endpoints allow unauhenticated requests for public + resources and they can be called without an API key. +
-
- All successful API requests will be returned with 200{' '}
- status code and ok: true in the response payload. If
- there’s an error while making the request, appropriate status code is
- returned with the error message:
-
+ All successful API requests will be returned with{' '}
+ 200 status code and ok: true in the
+ response payload. If there’s an error while making the request,
+ appropriate status code is returned with the error{' '}
+ message:
+
-
- {`{
+
+
+ {`{
"ok": false,
"error: "Not Found"
}
`}
-
-
+
+
+ - This method returns information for a document with a specific - ID. The following identifiers are allowed: -
-id field of the document
- outline-api-i48ZEZc5zjXndcP)
- + This method returns information for a document with a specific + ID. The following identifiers are allowed: +
+id field of the document
+ outline-api-i48ZEZc5zjXndcP)
+ parentDocument to set parent document.
- ID of the collection to which the document is
- created
-
- }
- required
- />
- ID of the parent document within the collection
-
- }
- />
- true by default. Pass false to
- create a draft.
-
- }
- />
- parentDocument to set parent document.
+ ID of the collection to which the document is
+ created
+
+ }
+ required
+ />
+ ID of the parent document within the
+ collection
+
+ }
+ />
+ true by default. Pass false to
+ create a draft.
+
+ }
+ />
+ true to publish a draft.
-
- }
- />
- true to signify an autosave. This skips
- creating a revision.
-
- }
- />
- true to signify the end of an editing
- session. This will trigger documents.update hooks.
-
- }
- />
- true to publish a draft.
+
+ }
+ />
+ true to signify an autosave. This skips
+ creating a revision.
+
+ }
+ />
+ true to signify the end of an editing
+ session. This will trigger documents.update hooks.
+
+ }
+ />
+ {props.method} - {props.label}
+ {props.method} {props.label}
- We’re building in public. Here’s what we’ve been changing recently. -
+We’re building in public. Here’s what has changed recently.