ข้อมูลการส่งอ้อย (Delivery)

API สำหรับเชื่อมโยงข้อมูลการส่งอ้อย จำกัดการเข้าถึงข้อมูลเฉพาะผู้ที่ได้รับอนุญาตเท่านั้น

ตัวอย่างการ authenticate และใช้ session

                        
                            import requests

                            # create a session
                            sess = requests.session()

                            # login into the system
                            data = {
                               "jsonrpc": "2.0",
                                "method": "call",
                                "params": {
                                    "db": "econtract",
                                    "login": "your_username",
                                    "password": "your_password"
                                }
                            }
                            sess.post('https://econtract.ocsb.go.th/web/session/authenticate', json=data)

                            # use this session to call your services
                            res = sess.get(
                                'https://econtract.ocsb.go.th/api/delivery/search?season=2563%2D2564'
                            )

                            print(res.json())
                        
                    

/get


Parameter
Name Description
bill_no required string เลขที่บิล
cane_type required string ชนิดอ้อย
contract_no required string เลขที่คู่สัญญา
factory_code required string รหัสโรงงาน
season required string ฤดูกาลเพาะปลูก
thai_no required string เลขประจำตัวประชาชน


Responses
Code Description
200 the request has succeeded.

Example Value

                                        
                                           {
                                              "thai_no": "string",
                                              "contract_no": "string",
                                              "delivered_cane": 0,
                                              "season": "string",
                                              "bill_no": "string",
                                              "factory_code": "string",
                                              "cane_type": "string",
                                              "truck_registration": "string",
                                              "sample_no": "string",
                                              "delivery_date": "2023-01-29",
                                              "ccs_value": 0
                                            }
                                        
                                    
400 One of the given parameter is not valid
401 The user is not authorized. Authentication is required
403 You don't have the permission to access the requested resource.
404 Requested resource not found

/search


Parameter
Name Description
bill_no string เลขที่บิล
cane_type string ชนิดอ้อย
contract_no string เลขที่คู่สัญญา
delivery_date string วันที่ส่งอ้อย
factory_code string รหัสโรงงาน
offset string Offset
season integer ฤดูกาลเพาะปลูก
thai_no string เลขประจำตัวประชาชน

Responses
Code Description
200 the request has succeeded.

Example Value

                                        
                                            [
                                              {
                                                "thai_no": "string",
                                                "contract_no": "string",
                                                "delivered_cane": 0,
                                                "season": "string",
                                                "bill_no": "string",
                                                "factory_code": "string",
                                                "cane_type": "string",
                                                "delivery_date": "2023-01-29"
                                              }
                                            ]
                                        
                                    
400 One of the given parameter is not valid
401 The user is not authorized. Authentication is required
403 You don't have the permission to access the requested resource.
404 Requested resource not found