A practical example on how to use Capmo's external API.
To get the latest version of the API client, check the official documentation.
When you browse an endpoint and select Node
as the language, you'll see a
snippet like the following:
# Install dependencies
npm i
# Install the Capmo API client, check the docs for the latest version
# and replace <version_hash> with the actual version hash
npx api install "@capmoapi/v1.0#<version_hash>"
This example uses TypeScript to implement the following flow of events in Capmo:
- Create new projects based on the name of existing folders in a given known
local directory [
PROJECTS_PATH
] - Ensure that a Contact Book Person exists for the API user's organisation
based on their email [
PERSON_TO_INVITE_EMAIL
] - For the first created project, add the Organisation Contact Book Person as a Project Contact Book Person
- Invite that Project Contact Book Person to the project as an
ADMIN
- Upload the first document to the same project that is found in a known local
directory [
DOCUMENTS_PATH
]
These variables should be set in the .env
file which you can copy from
.env.example
and fill in.
- Log in to your Capmo account at app.capmo.de
- Navigate to Account Settings → API Keys
- Create a new API Key
- Copy the key and add it to your
.env
file
Configure the following variables in your .env
file:
PROJECTS_PATH
: Directory containing project foldersPERSON_TO_INVITE_EMAIL
: Email of the person to inviteDOCUMENTS_PATH
: Directory containing documents to upload
Common issues and their solutions:
- Authentication Errors: Ensure your API token is valid and properly set in
.env
- Version Mismatch: Make sure you're using the latest API client version
- Permission Issues: Verify your account has the necessary permissions
- For API-specific questions, visit our official documentation
- For bugs or feature requests, please open an issue
- For additional support, contact our support team