Akses konten yang diterbitkan secara publik tanpa autentikasi. Bangun integrasi powerful dengan RESTful API kami.
https://public.simpulapi.id/public/{organizationId}Ganti {organizationId} dengan ID organisasi Anda dari dashboard.
Endpoint publik API tidak memerlukan autentikasi. Namun, jika tipe konten memiliki proteksi kunci API, sertakan kunci di header X-API-Key.
GET /public/{organizationId}/content/{contentTypeId}Parameter query: page, limit, search, sortBy, sortOrder
GET /public/{organizationId}/content/{contentTypeId}/{id}Ganti {id} dengan ID konten atau slug yang sebenarnya
GET /public/{organizationId}/content/{contentTypeId}/by-slug/{slug}Endpoint khusus untuk mengambil konten berdasarkan slug
GET /public/{organizationId}/search?q={query}Wajib: q (istilah pencarian)
Opsional: page, limit, contentTypeId
GET /public/{organizationId}/content-typesDapatkan semua tipe konten publik untuk organisasi ini
GET /public/{organizationId}/form-schema/{contentTypeId}Mengembalikan definisi formulir dengan semua field, aturan validasi, dan opsi
POST /public/{organizationId}/submit/{contentTypeId}Gunakan untuk formulir tanpa upload file. Kirim data sebagai JSON.
POST /public/{organizationId}/submit/{contentTypeId}/with-filesGunakan untuk formulir dengan upload file. Kirim data sebagai multipart/form-data.
Format: data[fieldName] untuk setiap field, file langsung dengan nama field
// Dapatkan semua konten
fetch('https://public.simpulapi.id/public/{organizationId}/content/{contentTypeId}')
.then(response => response.json())
.then(data => console.log(data));
// Dapatkan konten spesifik
fetch('https://public.simpulapi.id/public/{organizationId}/content/{contentTypeId}/{id}')
.then(response => response.json())
.then(data => console.log(data));
// Cari konten
fetch('https://public.simpulapi.id/public/{organizationId}/search?q=keyword')
.then(response => response.json())
.then(data => console.log(data));const response = await fetch('https://public.simpulapi.id/public/{organizationId}/submit/{contentTypeId}', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'YOUR_API_KEY' // Jika diperlukan
},
body: JSON.stringify({
fieldName1: 'value1',
fieldName2: 'value2'
})
});
const result = await response.json();
console.log(result); // { success: true, entryId: "..." }const formData = new FormData();
formData.append('data[textField]', 'Teks');
formData.append('data[emailField]', 'user@example.com');
// Tambah file
const fileInput = document.querySelector('input[type="file"]');
formData.append('fileField', fileInput.files[0]);
const response = await fetch('https://public.simpulapi.id/public/{organizationId}/submit/{contentTypeId}/with-files', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY' // Jika diperlukan
},
body: formData
});
const result = await response.json();
console.log(result);{
"message": "Pesan sukses",
"data": {
"items": [...],
"total": 100,
"page": 1,
"limit": 10,
"totalPages": 10
}
}{
"message": "Pesan sukses",
"data": {
"id": "content-id",
"title": "Judul Konten",
"slug": "content-slug",
"status": "published",
"data": { ... },
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z"
}
}{
"success": true,
"entryId": "content-item-id"
}