EpubKit Connect is a feature that allows you to connect your EpubKit App through HTTP API.
When EpubKit starts, it also launches an HTTP service at http://localhost:6143.
POST http://localhost:6143/save
Body:
url (required)
- URL of the articlehtml (required)
- HTML of the articlecollectionId (required)
- Collection ID to save the article totitle
- Title of the articleExample:
const response = await fetch('http://localhost:6143/save', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://example.com/article',
html: '<h1>Hello World</h1>',
collectionId: 'xxxx-xxxx-xxxx-xxxx',
title: 'Article Title',
}),
});
GET http://localhost:6143/collections
Return:
{
data: [
{
id: 'xxxx',
title: 'Collection Name',
},
{
// ...
}
]
}