Revolutionary Products For Industrial Engineering
Revolutionary Products For Industrial Engineering
Call Us Today
Working Hours
950 Zalpaca Avenue
All requests go to:
https://jdstudents.com/api/industries.php
Each Industry object looks like:
{
"id": "1",
"name": "Technology",
"short_info": "Software, AI, Cloud",
"description": "All tech-related fields.",
"sort_order": "1",
"is_active": "1",
"created_at": "2025-12-09 10:00:00",
"updated_at": "2025-12-09 10:00:00"
}
| Action | Method | URL Example |
|---|---|---|
| List all industries | GET | /api/industries.php |
| List active industries only | GET | /api/industries.php?active=1 |
| Get one industry | GET | /api/industries.php?id=1 |
| Create new industry | POST | /api/industries.php |
| Update industry (easy external way) | POST | /api/industries.php?action=update&id=1 |
| Update industry (REST style) | PUT | /api/industries.php?id=1 |
| Delete industry | DELETE | /api/industries.php?id=3 |
Put this inside your index.html:
<div id="industries-list"></div>
<script>
async function loadIndustries(){
// 1) Call API
const res = await fetch('/api/industries.php?active=1');
// 2) Convert response to JSON
const json = await res.json();
// 3) Check success
if(!json.ok) {
console.log("API error:", json);
return;
}
// 4) Render on page
const box = document.getElementById('industries-list');
box.innerHTML = '';
json.data.forEach(i => {
const div = document.createElement('div');
div.innerHTML = `<h3>${i.name}</h3><p>${i.short_info ?? ''}</p>`;
box.appendChild(div);
});
}
document.addEventListener('DOMContentLoaded', loadIndustries);
</script>
curl "https://jdstudents.com/api/industries.php?active=1"
curl -X POST "https://jdstudents.com/api/industries.php" \
-H "Content-Type: application/json" \
-d '{
"name":"Education",
"short_info":"Universities, schools, edtech",
"description":"Learning and training services.",
"sort_order":4,
"is_active":1
}'
curl -X POST "https://jdstudents.com/api/industries.php?action=update&id=1" \ -d "name=Technology" \ -d "short_info=Software, AI, Cloud, Cybersecurity" \ -d "description=All tech fields and careers" \ -d "sort_order=1" \ -d "is_active=1"
curl -X PUT "https://jdstudents.com/api/industries.php?id=1" \
-H "Content-Type: application/json" \
-d '{"short_info":"Updated info","sort_order":1}'
curl -X DELETE "https://jdstudents.com/api/industries.php?id=3"
{
"ok": true,
"data": [...]
}
{
"ok": false,
"error": "Message here"
}