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 Repository
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.
How do I make a Commit?
Currently the only way to commit data to a WarmHub repo, is through the repo specific API.
What is the API address for my repo?
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
What is the format of the payload, I need to 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).
An example commit for your repo, can be found on the about page of the repo.
The easiest way to get the Commit Schema for your repo is to click the Copy Commit Schema button, located on the about page for your repo.
How do I authenticate when posting a commit?
When making API requests to WarmHub, you must include your Personal Access Token in the HTTP request header as follows:
Once on the page, you can click the Create Token button , name your token so you will remember what it is used for, and set the timeline for its expiration. Once you click Create Token, your token will be shown on the screen for you to copy. This is the only time you will be able to view your token, so if you will need it again later, make sure you store it somewhere safe.
Last updated