ข้อมูลการส่งอ้อย (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
|
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
|
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 |