Dga Key

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));