Error Codes

ETrackings ใช้ HTTP response codes มาตรฐาน รหัส 2xx คือสำเร็จ รหัส 4xx คือ error จากข้อมูลที่ส่งมา รหัส 5xx คือ error จากฝั่ง server

HTTP Status Code meta.code ตัวอย่าง Error Message
400 400 Parameter ไม่ถูกต้อง
401 401 API Key หรือ Key Secret ไม่ถูกต้อง
403 403 Request ถูกรับแต่ถูกปฏิเสธ — ไม่มีสิทธิ์เข้าถึง
404 404 URI ไม่ถูกต้อง หรือ resource ที่ต้องการไม่มีอยู่
429 429 เกิน rate limit ค่าเริ่มต้น 10 requests ต่อวินาที
500 502 503 504
500 502 503 504
เกิดข้อผิดพลาดจากฝั่ง ETrackings

กรณี API Key หรือ Key Secret ไม่ถูกต้อง

{
  "meta": {
    "code": 401,
    "message": "Invalid API key or Key secret."
  }
}

กรณีชื่อขนส่งไม่ถูกต้อง

{
  "meta": {
    "code": 404,
    "message": "The URI requested is invalid or the resource requested does not exist."
  }
}

กรณี server ล่ม

{
  "meta": {
    "code": 500,
    "message": "Something went wrong on ETrackings end."
  },
  "data": {}
}