Ukwenza Izicelo
Ukuze ufinyelele i-API, okudingeka ukwenze nje ukwenza isicelo se-HTTP GET endaweni efanele.
Isibonelo, ukuze ufinyelele iphuzu lokugcina available_translations.json , ungasebenzisa umyalo olandelayo we-JavaScript noma we-cURL:
fetch(`https://bible.helloao.org/api/available_translations.json`)
.then(request => request.json())
.then(availableTranslations => {
console.log('The API has the following translations:', availableTranslations);
});curl https://bible.helloao.org/api/available_translations.jsonNgezansi, ungathola uhlu lwezibonelo. Ukuze uthole imibhalo ephelele, bheka i- Reference Documentation .
Izibonelo
Thola Uhlu Lokuhumusha Okutholakalayo
( inkomba )
GET https://bible.helloao.org/api/available_translations.json
fetch(`https://bible.helloao.org/api/available_translations.json`)
.then(request => request.json())
.then(availableTranslations => {
console.log('The API has the following translations:', availableTranslations);
});curl https://bible.helloao.org/api/available_translations.jsonBhala Izincwadi Ezihunyushweni
( inkomba )
GET https://bible.helloao.org/api/{translation}/books.json
// Thola uhlu lwezincwadi zokuhumusha i-BSB
fetch(`https://bible.helloao.org/api/BSB/books.json`)
.then(request => request.json())
.then(books => {
console.log('The BSB has the following books:', books);
});curl https://bible.helloao.org/api/BSB/books.jsonThola Isahluko Esihunyushweni
( inkomba )
GET https://bible.helloao.org/api/{translation}/{book}/{chapter}.json
// Thola uGenesise 1 enguqulweni ye-BSB
fetch(`https://bible.helloao.org/api/BSB/GEN/1.json`)
.then(request => request.json())
.then(chapter => {
console.log('Genesis 1 (BSB):', chapter);
});curl https://bible.helloao.org/api/BSB/GEN/1.jsonThola Isahluko Esenziwe Lula Enguqulweni
( inkomba )
GET https://bible.helloao.org/api/{translation}/{book}/{chapter}.simple.json
Sebenzisa lokhu uma ufuna umbhalo wesahluko kuphela. Ivesi ngalinye liqukethe umucu owodwa ongu text esikhundleni sohlu lokuqukethwe okufomethiwe, ngakho akudingeki ukuthi uzakhele umbhalo ngokwakho.
// Thola umbhalo kaGenesise 1 enguqulweni ye-BSB
fetch(`https://bible.helloao.org/api/BSB/GEN/1.simple.json`)
.then(request => request.json())
.then(chapter => {
for (let content of chapter.chapter.content) {
if (content.type === 'verse') {
console.log(`${content.number}. ${content.text}`);
}
}
});curl https://bible.helloao.org/api/BSB/GEN/1.simple.jsonThola Uhlu Lwamazwana Atholakalayo
( inkomba )
fetch(`https://bible.helloao.org/api/available_commentaries.json`)
.then(request => request.json())
.then(availableCommentaries => {
console.log('The API has the following commentaries:', availableCommentaries);
});curl https://bible.helloao.org/api/available_commentaries.jsonBhala Izincwadi Kumazwana
( inkomba )
const commentary = 'adam-clarke';
// Thola uhlu lwezincwadi zokuphawula kuka-adam-clarke
fetch(`https://bible.helloao.org/api/c/${commentary}/books.json`)
.then(request => request.json())
.then(books => {
console.log('The adam-clarke commentary has the following books:', books);
});curl https://bible.helloao.org/api/c/adam-clarke/books.jsonThola Isahluko Kumazwana
( inkomba )
const commentary = 'adam-clarke';
const book = 'GEN';
const chapter = 1;
// Thola uGenesise 1 kumazwana ka-adam-clarke
fetch(`https://bible.helloao.org/api/c/${commentary}/${book}/${chapter}.json`)
.then(request => request.json())
.then(chapter => {
console.log('Genesis 1 (adam-clarke):', chapter);
});curl https://bible.helloao.org/api/c/adam-clarke/GEN/1.jsonBhala Amaphrofayili Kumazwana
( inkomba )
const commentary = 'tyndale';
// Thola uhlu lwamaphrofayili okuphawula kukaTyndale
fetch(`https://bible.helloao.org/api/c/${commentary}/profiles.json`)
.then(request => request.json())
.then(profiles => {
console.log('The tyndale commentary has the following profiles:', profiles);
});curl https://bible.helloao.org/api/c/tyndale/profiles.jsonThola Iphrofayili Kumazwana
( inkomba )
const commentary = 'tyndale';
const profile = 'aaron';
// Thola iphrofayela ka-aaron kumazwana ka-tyndale
fetch(`https://bible.helloao.org/api/c/${commentary}/profiles/${profile}.json`)
.then(request => request.json())
.then(profile => {
console.log('The Aaron tyndale commentary profile:', profile);
});curl https://bible.helloao.org/api/c/tyndale/profiles/aaron.jsonThola uhlu lwamasethi edatha atholakalayo
( inkomba )
fetch(`https://bible.helloao.org/api/available_datasets.json`)
.then(request => request.json())
.then(availableDatasets => {
console.log('The API has the following datasets:', availableDatasets);
});curl https://bible.helloao.org/api/available_datasets.jsonThola uhlu lwezincwadi kusethi yedatha
( inkomba )
const dataset = 'open-cross-ref';
// Thola uhlu lwezincwadi zedatha ye-open-cross-ref
fetch(`https://bible.helloao.org/api/d/${dataset}/books.json`)
.then(request => request.json())
.then(books => {
console.log('The open-cross-ref dataset has the following books:', books);
});curl https://bible.helloao.org/api/d/open-cross-ref/books.jsonThola Isahluko ku-Dataset
( inkomba )
const dataset = 'open-cross-ref';
const book = 'GEN';
const chapter = 1;
// Thola uGenesise 1 kusethi yedatha ye-open-cross-ref
fetch(`https://bible.helloao.org/api/d/${dataset}/${book}/${chapter}.json`)
.then(request => request.json())
.then(chapter => {
console.log('Genesis 1 (open-cross-ref):', chapter);
});curl https://bible.helloao.org/api/d/open-cross-ref/GEN/1.json