Committing To Your Repo
The only way to get data into your repo in WarmHub, is through a commit. Once you have created your repo, and setup your types, you are ready to start committing data to it. If your repo is not setup, or if you have questions about creating a repo or types, see: Creating a Repo
All of the data in WarmHub is part of an immutable chain. This means that data can never be deleted from WarmHub, and the only way it can be changed is through a commit. In a commit you can do any number of the following operations:
Additions - This is how data (Articles, Evidence, and Claims) are added to a repo.
Revisions - This is how existing data (Articles, Evidence, and Claims) can be modified or updated
Retractions - This is how existing data (Articles, Evidence, and Claims) can be retracted from the head of a repo.
It is important to note, that a retraction does not mean the data was deleted, just that it has been removed from the head, or most recent version of the repo. The data will still be visible in prior versions of the repo.
SDKs
On the about page of your repo, you can find a variety of SDKs that can help you easily make commits to your repo.
Repo Specific API Address
Each repo in WarmHub has its own endpoint where commits are posted. The easiest way to get the API address for commits to your repo is to click the Copy Commit Endpoint button, located on the about page for your repo.
However, for each repo, the commit endpoint will be:
https://.warmhub.com/api/{org name}/{repo name}/commits
Formatting Commit
When committing data to your WarmHub repository via the API, it's essential to structure your payload correctly to ensure successful ingestion. Each commit payload must contain three arrays: additions, revisions, and retractions.
Each addition must specify a type and include all required fields as defined by your repository's Type Set. Subsequent additions, revisions, or attractions to an existing article, evidence, or claim must reference the previously created article/evidence/claim using a WarmHub reference ($wref).
API Authentication
When making API requests to WarmHub, you must include your Personal Access Token in the HTTP request header as follows:
Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN
To learn more about creating Personal Access Tokens, see: Personal Access Tokens
Last updated