DocScout
NodeJS client for HelpScout Docs API written in TypeScript
Install
$ npm install docscout
Usage
Functional
const apiToken = processenvHELPSCOUT_DOCS_API_TOKEN; async { try const collectionsEnvelope = await ; console; catch error console; };
OOP Client Instance
The OOP Client has two subtle differences from the functional approach:
- Stores the API token internally so that you don't have to pass it in every single function call.
- Unboxes the envelope data from the API responses. More info about HS Docs Data Envelopes
const apiToken = processenvHELPSCOUT_DOCS_API_TOKEN; async { try const docscoutClient = apiToken; const collections = await docscoutClient; console; catch error console; };
API
Version 1 of this client focuses on fetching data, i.e. the API Reads.
We'll happily welcome your PRs to improve this client.
Source Code
Articles |Docs
List Articles |In Collection
listArticlesInCollection apiToken: string, collectionId: string, options?: ListArticleOptions
In Category
listArticlesInCategory apiToken: string, categoryId: string, options?: ListArticleOptions
Docs
Search Articles |searchArticles apiToken: string, options: SearchArticlesOptions
Docs
List Related Articles |listRelatedArticles apiToken: string, articleId: string, options?: ListRelatedArticlesOptions
Docs
List Revisions |listRevisions apiToken: string, articleId: string, options?: ListRevisionsOptions
Docs
Get Article |getArticle apiToken: string, articleIdOrNumber: string | number, options?: GetArticleOptions
Docs
Get Revision |getRevision apiToken: string, revisionId: string
Source Code
Assets |Docs
Create Article Asset |createArticleAsset apiToken: string, options: CreateArticleAssetOptions
Source Code
Categories |Docs
List Categories |listCategories apiToken: string, collectionId: string, options?: ListCategoriesOptions
Docs
Get Category |getCategory apiToken: string, categoryIdOrNumber: string | number
Source Code
Collections |Docs
List Collections |listCollections apiToken: string, options?: ListCollectionsOptions
Docs
Get Collection |getCollection apiToken: string, collectionIdOrNumber: string | number
Source Code
Sites |Docs
List Sites |listSites apiToken: string, options?: ListSitesOptions
License
Copyright (c) 2019 You Need A Budget, LLC
Licensed under the Apache-2.0 license