DataCatalog
EGP API Endpoints
Get All EGP Posts
Endpoint: https://sd3.wpdevs.co/wp-json/egp/v1/posts
Method: GET
Description: Returns all published EGP posts with their custom fields
Available Fields:
egp_no- รหัสโครงการegp_name- ชื่อโครงการegp_type- ประเภทประกาศegp_way- วิธีจัดหาegp_date_start- วันที่ประกาศegp_sub_dep- สำนัก/กองegp_dep- หน่วยงานegp_files- เอกสาร/ไฟล์แนบ
Get Single EGP Post
Endpoint: https://sd3.wpdevs.co/wp-json/egp/v1/posts/{id}
Method: GET
Description: Returns a single EGP post with all custom fields
Parameters:
id- The post ID (required)
Example Response
{
"id": 123,
"title": "Example Project",
"date": "2024-02-15",
"modified": "2024-02-15",
"egp_no": "EGP2024001",
"egp_name": "โครงการตัวอย่าง",
"egp_type": "ประกาศเชิญชวน",
"egp_way": "e-bidding",
"egp_date_start": "2024-02-15",
"egp_sub_dep": "สำนักงานเลขานุการกรม",
"egp_dep": "กรมบัญชีกลาง",
"egp_files": [
{
"url": "path/to/file.pdf",
"title": "เอกสารประกวดราคา"
}
],
"meta": {
"post_type": "egp",
"post_status": "publish"
}
}
Example Usage
// JavaScript fetch example
fetch("https://sd3.wpdevs.co/wp-json/egp/v1/posts")
.then(response => response.json())
.then(data => console.log(data));
MPeople API Endpoints
Get All MPeople Posts
Endpoint: https://sd3.wpdevs.co/wp-json/mpeople/v1/posts
Method: GET
Description: Returns all published MPeople posts with their custom fields
Available Fields:
at_content- เนื้อหาบทความat_file_standard- เอกสารมาตรฐาน (Repeater field)at_rp_file_name- ชื่อไฟล์at_rp_file_create- วันที่นำเข้าat_rp_file_link- ลิงค์ไฟล์
Get Single MPeople Post
Endpoint: https://sd3.wpdevs.co/wp-json/mpeople/v1/posts/{id}
Method: GET
Description: Returns a single MPeople post with all custom fields
Parameters:
id- The post ID (required)
Example Response
{
"id": 123,
"title": "Example Post",
"date": "2024-02-15",
"modified": "2024-02-15",
"at_content": "เนื้อหาบทความ...",
"at_file_standard": [
{
"at_rp_file_name": "ชื่อไฟล์ 1",
"at_rp_file_create": "2024-02-15",
"at_rp_file_link": "https://example.com/file1.pdf"
},
{
"at_rp_file_name": "ชื่อไฟล์ 2",
"at_rp_file_create": "2024-02-15",
"at_rp_file_link": "https://example.com/file2.pdf"
}
],
"meta": {
"post_type": "mpeople",
"post_status": "publish"
}
}
News API Endpoints
Get All News Posts
Endpoint: https://sd3.wpdevs.co/wp-json/news/v1/posts
Method: GET
Description: Returns all published News posts with their custom fields
Available Fields:
content- เนื้อหาบทความfile_standard- เอกสารมาตรฐาน
Get Single News Post
Endpoint: https://sd3.wpdevs.co/wp-json/news/v1/posts/{id}
Method: GET
Description: Returns a single News post with all custom fields
Parameters:
id- The post ID (required)
Example Response
{
"id": 123,
"title": "Example News Article",
"date": "2024-02-15",
"modified": "2024-02-15",
"content": "เนื้อหาบทความตัวอย่าง",
"file_standard": [
{
"url": "path/to/file.pdf",
"title": "เอกสารมาตรฐาน"
}
],
"meta": {
"post_type": "news",
"post_status": "publish"
}
}
Example Usage
// JavaScript fetch example
fetch("https://sd3.wpdevs.co/wp-json/news/v1/posts")
.then(response => response.json())
.then(data => console.log(data));