diff --git a/src/app/components/CodeSnippet.module.css b/src/app/components/CodeSnippet.module.css index 7d04f98..f0eaa76 100644 --- a/src/app/components/CodeSnippet.module.css +++ b/src/app/components/CodeSnippet.module.css @@ -100,7 +100,6 @@ color: white; border-radius: 5px; cursor: pointer; - appearance: none; padding-left: 2rem; text-align: right; font-size: 1rem; diff --git a/src/app/components/Section.module.css b/src/app/components/Section.module.css index 258a254..8b484bb 100644 --- a/src/app/components/Section.module.css +++ b/src/app/components/Section.module.css @@ -36,7 +36,6 @@ .container>article code { background-color: #0b3766; - padding: 0.1rem 0.5rem; border-radius: 5px; } @@ -47,11 +46,15 @@ } @media screen and (min-width: 1000px) { - .container>article:nth-child(2)>h1 { + .container>article:nth-child(2)>h1:nth-child(1) { padding-top: 75px; } } +.container>article:nth-child(2)>h1:not(:first-child) { + margin-top: 1rem; +} + .container>article h2, .container>article h3 { margin-top: 1rem; diff --git a/src/docs/version_001/introduction/example.md b/src/docs/version_001/introduction/example.md index 40ad31b..b40a855 100644 --- a/src/docs/version_001/introduction/example.md +++ b/src/docs/version_001/introduction/example.md @@ -1,6 +1,6 @@ # Base URL -The base url for the Onspring API will be the same for all instances regardless of whether the instances is a development, test, or production instance. +The base url for the Onspring API will be the same for all instances regardless of whether the instances is a development, test, or production instance. The routing of the request to the correct instance be based on the API key provided in the request. {% code heading="BASE URL" defaultLanguage="text" %} diff --git a/src/docs/version_002/authentication/copy.md b/src/docs/version_002/authentication/copy.md index f9105ad..7b5c9e5 100644 --- a/src/docs/version_002/authentication/copy.md +++ b/src/docs/version_002/authentication/copy.md @@ -1,6 +1,6 @@ # Authentication {% #authentication %} -The Onpsring API uses API keys to authenticate requests. You can view and manage your API keys from within your instance. +The Onpsring API uses API keys to authenticate requests. These keys are specific to a given Onspring instance. You can view and manage your API keys from within your instance. An API key needs to be provided with every request. This is done by adding the `X-ApiKey` header to the request. The API key provided should be in an `Enabled` status and it should be assigned a role that has the proper permissions for the request made by the API key. The role assigned should also be in an `Active` status. diff --git a/src/docs/version_002/docsStructure.ts b/src/docs/version_002/docsStructure.ts index c3ab3a3..f7b49a7 100644 --- a/src/docs/version_002/docsStructure.ts +++ b/src/docs/version_002/docsStructure.ts @@ -32,6 +32,13 @@ export const versionTwo: DocsStructure = { example: 'example.md', children: [], }, + { + title: 'Error Handling', + folder: 'error_handling', + copy: 'copy.md', + example: 'example.md', + children: [], + }, { title: 'Resources', folder: 'resources', diff --git a/src/docs/version_002/error_handling/copy.md b/src/docs/version_002/error_handling/copy.md index 68452be..0727b87 100644 --- a/src/docs/version_002/error_handling/copy.md +++ b/src/docs/version_002/error_handling/copy.md @@ -1,5 +1,27 @@ -# Error Handling +# Error Handling {% #error-handling %} The Onspring API uses conventional HTTP response codes to indicate the success or failure of an API request. Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided. Codes in the 5xx range indicate an error within Onspring's servers. -Some 4xx errors will also include an error object in the response body. This object can contain additional information about the error. +The internet is a big place and requests sent across the network should be treated as if they may fail at any time. We recommend that you implement a retry strategy for requests that fail. This will help to ensure that your application is able to recover from any network issues that may occur. + +**Note:** The exception to this is if you receive a `499` status code this indicates that the request has exceeded the 90 second timeout limit of our api gateway. This is not an error with the request itself, but rather a timeout. This is a result of the request taking too long to process. Typically this is due to a large amount of data being requested or a request triggering a lot of processing. If you receive this error, you should consider breaking up your request into smaller requests. + +Some 4xx errors will also include an `Error` object in the response body. This object can contain a message with additional information about the error. + +## Error Properties + +{% table %} + +- Property Name +- Data Type +- Description + +--- + +- message +- `string` +- A human-readable message describing the error. + +{% table %} + +**Note:** The `message` property is not guaranteed to be present in the response body. The response body may be empty or contain other properties. diff --git a/src/docs/version_002/error_handling/example.md b/src/docs/version_002/error_handling/example.md index e69de29..317f7fe 100644 --- a/src/docs/version_002/error_handling/example.md +++ b/src/docs/version_002/error_handling/example.md @@ -0,0 +1,26 @@ +# Error Code Summary + +{% code heading="ERROR CODES" defaultLanguage="text" %} + +```text +400 Bad Request - The request was unacceptable, often due to missing a required parameter. +401 Unauthorized - No valid API key provided. +403 Forbidden - The API key doesn't have permissions to perform the request. +404 Not Found - The requested resource doesn't exist. +499 Client Closed Request - Our API gateway closed the connection because the request exceeded the 90 second timeout limit. +5xx Server Errors - Something went wrong on Onspring's end. +``` + +{% /code %} + +# The Error Object + +{% code heading="ERROR OBJECT" defaultLanguage="json" %} + +```json +{ + "message": "Client does not have access to read app: 1" +} +``` + +{% /code %} diff --git a/src/docs/version_002/introduction/example.md b/src/docs/version_002/introduction/example.md index e92004c..5998dbc 100644 --- a/src/docs/version_002/introduction/example.md +++ b/src/docs/version_002/introduction/example.md @@ -1,6 +1,6 @@ # Base URL -The base url for the Onspring API will be the same for all instances regardless of whether the instances is a development, test, or production instance. +The base url for the Onspring API will be the same for all instances regardless of whether the instances is a development, test, or production instance. The routing of the request to the correct instance be based on the API key provided in the request. {% code heading="BASE URL" defaultLanguage="text" %}