readme
Module readme
API
![](https://bcentral-packageicons.azureedge.net/images/ballerinax_readme_1.2.0.png)
ballerinax/readme Ballerina library
Overview
This is a generated connector for Readme API v2.0 OpenAPI specification.
The Readme API provides the capability to create product and API documentation programmatically.
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create a Readme account.
- Obtain tokens - Follow this guide.
Quickstart
To use the Readme connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
First, import the ballerinax/readme module into the Ballerina project.
import ballerinax/readme;
Step 2: Create a new connector instance
You can now make the connection configuration using the Readme API keys config.
http:CredentialsConfig & readonly authConfig = ?; readme:ClientConfig clientConfig = {auth : authConfig}; readme:Client readmeClient = check new (clientConfig);
Step 3: Invoke connector operation
Following is code demonstrates how to get a project using ballerinax/readme
connector.
public function main() returns error? { http:Response entity = check readmeClient->getProject(); }
Clients![](/images/permalink.svg)
readme: Client![](/images/permalink.svg)
This is a generated connector for Readme API v2.0 OpenAPI specification.
The Readme API provides the capability to create product and API documentation programmatically.
Constructor![](/images/permalink.svg)
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Create a Readme account and obtain tokens by following this guide.
init (ClientConfig clientConfig, string serviceUrl)
- clientConfig ClientConfig - The configurations to be used when initializing the
connector
- serviceUrl string "https://dash.readme.io/api/v1" - URL of the target service
getProject![](/images/permalink.svg)
Get metadata about the current project
getAPISpecification![](/images/permalink.svg)
Get API specification metadata
Parameters
- xReadmeVersion string - Version number of your docs project, for example, v3.0. To see all valid versions for your docs project call https://docs.readme.com/developers/reference/version#getversions.
- perPage int (default 10) - Number of items to include in pagination (up to 100, defaults to 10)
- page int (default 1) - Used to specify further pages (starts at 1)
uploadAPISpecification![](/images/permalink.svg)
Upload an API specification to ReadMe. Or, to use a newer solution see https://docs.readme.com/guides/docs/automatically-sync-api-specification-with-github
Parameters
- xReadmeVersion string - Version number of your docs project, for example, v3.0. To see all valid versions for your docs project call https://docs.readme.com/developers/reference/version#getversions.
- payload File - File
updateAPISpecification![](/images/permalink.svg)
Update an API specification in ReadMe
Parameters
- id string - ID of the API specification. The unique ID for each API can be found by navigating to your API Definitions page.
- payload File - File
deleteAPISpecification![](/images/permalink.svg)
Delete an API specification in ReadMe
Parameters
- id string - ID of the API specification. The unique ID for each API can be found by navigating to your API Definitions page.
getCategory![](/images/permalink.svg)
Get category
Parameters
- slug string - Slug of category. Slugs must be all lowercase, and replace spaces with hyphens. For example, for the the category "Getting Started", enter the slug "getting-started"
- xReadmeVersion string - Version number of your docs project, for example, v3.0. To see all valid versions for your docs project call https://docs.readme.com/developers/reference/version#getversions.
getCategoryDocs![](/images/permalink.svg)
Get docs for category
Parameters
- slug string - Slug of category. Slugs must be all lowercase, and replace spaces with hyphens. For example, for the the category "Getting Started", enter the slug "getting-started"
- xReadmeVersion string - Version number of your docs project, for example, v3.0. To see all valid versions for your docs project call https://docs.readme.com/developers/reference/version#getversions.
getChangelogs![](/images/permalink.svg)
Get changelogs
Parameters
- perPage int (default 10) - Number of items to include in pagination (up to 100, defaults to 10)
- page int (default 1) - Used to specify further pages (starts at 1)
createChangelog![](/images/permalink.svg)
Create changelog
Parameters
- payload Changelog - Changelog object
getChangelog![](/images/permalink.svg)
Get changelog
Parameters
- slug string - Slug of changelog
updateChangelog![](/images/permalink.svg)
Update changelog
deleteChangelog![](/images/permalink.svg)
Delete changelog
Parameters
- slug string - Slug of changelog
getCustomPages![](/images/permalink.svg)
Get custom pages
Parameters
- perPage int (default 10) - Number of items to include in pagination (up to 100, defaults to 10)
- page int (default 1) - Used to specify further pages (starts at 1)
createCustomPage![](/images/permalink.svg)
function createCustomPage(CustomPage payload) returns Response|error
Create custom page
Parameters
- payload CustomPage - CustomPage object
getCustomPage![](/images/permalink.svg)
Get custom page
Parameters
- slug string - Slug of custom page
updateCustomPage![](/images/permalink.svg)
function updateCustomPage(string slug, CustomPage payload) returns Response|error
Update custom page
deleteCustomPage![](/images/permalink.svg)
Delete custom page
Parameters
- slug string - Slug of custom page
createDoc![](/images/permalink.svg)
Create doc
Parameters
- xReadmeVersion string - Version number of your docs project, for example, v3.0. To see all valid versions for your docs project call https://docs.readme.com/developers/reference/version#getversions.
- payload Doc - Doc object
searchDocs![](/images/permalink.svg)
Search docs
Parameters
- search string - Search string to look for
- xReadmeVersion string - Version number of your docs project, for example, v3.0. To see all valid versions for your docs project call https://docs.readme.com/developers/reference/version#getversions.
getDoc![](/images/permalink.svg)
Get doc
Parameters
- slug string - Slug of doc. must be lowercase, and replace spaces with hyphens. For example, for the page titled "New Features", enter the slug "new-features"
- xReadmeVersion string - Version number of your docs project, for example, v3.0. To see all valid versions for your docs project call https://docs.readme.com/developers/reference/version#getversions.
updateDoc![](/images/permalink.svg)
Update doc
Parameters
- slug string - Slug of doc. must be lowercase, and replace spaces with hyphens. For example, for the page titled "New Features", enter the slug "new-features"
- xReadmeVersion string - Version number of your docs project, for example, v3.0. To see all valid versions for your docs project call https://docs.readme.com/developers/reference/version#getversions.
- payload Doc - Doc object
deleteDoc![](/images/permalink.svg)
Delete doc
Parameters
- slug string - Slug of doc. must be lowercase, and replace spaces with hyphens. For example, for the page titled "New Features", enter the slug "new-features"
- xReadmeVersion string - Version number of your docs project, for example, v3.0. To see all valid versions for your docs project call https://docs.readme.com/developers/reference/version#getversions.
getErrors![](/images/permalink.svg)
Get errors
deleteSwagger![](/images/permalink.svg)
DEPRECATED. Instead, use https://docs.readme.com/developers/reference/api-specification#deleteapispecification to delete a Swagger file in ReadMe
Parameters
- id string - ID of swagger the file
getVersions![](/images/permalink.svg)
Get versions
createVersion![](/images/permalink.svg)
Create version
Parameters
- payload Version - Version object
Return Type
getVersion![](/images/permalink.svg)
Get version
Parameters
- versionId string - Semver version indentifier
updateVersion![](/images/permalink.svg)
Update version
deleteVersion![](/images/permalink.svg)
Delete version
Parameters
- versionId string - Semver version indentifier
Records![](/images/permalink.svg)
readme: Changelog![](/images/permalink.svg)
Fields
- body string - Body content of the changelog
- hidden boolean? - Visibility of the changelog
- title string - Title of the changelog
- 'type string? -
readme: ClientConfig![](/images/permalink.svg)
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- auth CredentialsConfig - Configurations related to client authentication
- httpVersion string(default "1.1") - The HTTP version understood by the client
- http1Settings ClientHttp1Settings(default {}) - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings(default {}) - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- followRedirects FollowRedirects?(default ()) - Configurations associated with Redirection
- poolConfig PoolConfiguration?(default ()) - Configurations associated with request pooling
- cache CacheConfig(default {}) - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig?(default ()) - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig?(default ()) - Configurations associated with retrying
- cookieConfig CookieConfig?(default ()) - Configurations associated with cookies
- responseLimits ResponseLimitConfigs(default {}) - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket?(default ()) - SSL/TLS-related options
readme: CustomPage![](/images/permalink.svg)
Fields
- body string? - Body formatted in Markdown (displayed by default).
- hidden boolean? - Visibility of the custom page
- html string? - Body formatted in HTML (sanitized, only displayed if
htmlmode
is true).
- htmlmode boolean? - true if
html
should be displayed, false ifbody
should be displayed.
- title string - Title of the custom page
readme: Doc![](/images/permalink.svg)
Fields
- body string? - Body content of the page, formatted in ReadMe or Github flavored Markdown. Accepts long page content, for example, greater than 100k characters
- category string - Category ID of the page, which you can get through https://docs.readme.com/developers/reference/categories#getcategory
- hidden boolean? - Visibility of the page
- parentDoc string? - For a subpage, specify the parent doc ID, which you can get through https://docs.readme.com/developers/reference/docs#getdoc
- title string - Title of the page
- 'type string? - Type of the page. The available types all show up under the /docs/ URL path of your docs project (also known as the "guides" section). Can be "basic" (most common), "error" (page desribing an API error), or "link" (page that redirects to an external link)
readme: File![](/images/permalink.svg)
Fields
- spec string? - OpenAPI/Swagger file
readme: Version![](/images/permalink.svg)
Fields
- codename string? - Dubbed name of version
- 'from string - Semantic Version to use as the base fork
- is_beta boolean? -
- is_deprecated boolean? - Should this be deprecated? Only allowed in PUT operations
- is_hidden boolean? - Should this be publically accessible?
- is_stable boolean? - Should this be the main version
- 'version string - Semantic Version
Import
import ballerinax/readme;
Metadata
Released date: over 2 years ago
Version: 1.2.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.0.0
GraalVM compatible: Yes
Pull count
Total: 2
Current verison: 0
Weekly downloads
Keywords
Content & Files/Documents
Cost/Freemium
Contributors