Authentication
The TechWriter API uses API keys to authenticate requests. You can view and manage your API keys in the TechWriter Dashboard.
Test secret keys have the prefix tw_test_ and live mode secret keys have the prefix tw_live_. Alternatively, you can use restricted API keys for granular permissions.
Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Authentication to the API is performed via an Authorization: Bearer header. Pass your API key as the Bearer token value on every request. The cURL shorthand uses HTTP Basic Auth with your key as the username and an empty password — both methods produce the same Authorization header.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
Initialize TechWriterClient
Use your API key by setting it in the initial configuration. The Node.js library will then automatically send this key in each request.
import TechWriter from ;
const tw = new TechWriter();Per-Request API Key
You can also set a per-request key with an option. This is often useful for applications that use multiple API keys during the lifetime of a process.
const group = await tw.groups.retrieve(
,
{ apiKey: }
);Your Test API Key
tw_test_51H59ow...Dm2DtReplace with your live key for production.