109
เข้าสู่ระบบ

หรือ

ลงทะเบียน

|

Thai English

Report Event API

For creates a new traffic-related event (e.g., car breakdown, incident, road issue) in the Longdo Traffic system using multipart/form-data.

Authentication

  • Uses username and password fields in the body for authentication.
  • Assumes these credentials are valid Longdo Traffic service credentials (can be applied at https://www.longdo.com/user/register).

Request

Method: POST
URL: https://event.longdo.com/services/addevent
Body type: multipart/form-data

Body Fields

  • username (string, required)
    • Account name used to authenticate the requester.
  • password (string, required)
    • MD5 Password hash used for authentication.
  • title (string, required)
    • Event title in Thai.
  • title_en (string, optional)
    • Event title in English.
  • detail (string, required)
    • Detailed description of the event in Thai.
  • detail_en (string, optional)
    • Detailed description of the event in English.
  • lat (number, required)
    • Latitude of the event location in decimal degrees (WGS84).
  • lon (number, required)
    • Longitude of the event location in decimal degrees (WGS84).
  • start (string, required)
    • Event start date-time in YYYY-MM-DD HH:MM:SS format (local time zone).
  • stop (string, required)
    • Expected end date-time in YYYY-MM-DD HH:MM:SS format.
  • image (binary, optional)
    • Image of the event in image/jpg or image/png content type.
  • tags (string, required)
  • format (string, required)
    • Response type. Defined as json.

Example request

curl --location 'https://event-test.longdo.com/services/addevent' \
--form 'username="testuser"' \
--form 'password="xxxxxxxxxxxxx"' \
--form 'title="รถชนบนทางด่วน"' \
--form 'detail="เกิดเหตุรถยนต์ส่วนบุคคลชนกันบนทางด่วน"' \
--form 'lat="13.79526147636889"' \
--form 'lon="100.949123552122"' \
--form 'start="2026-01-02 11:30:16"' \
--form 'stop="2026-01-03 23:42:17"' \
--form 'tags="อุบัติเหตุ"' \
--form 'format="json"'

Response

  • HTTP status: 200 OK on a processed request (both success and logical failure are reported via the JSON body).
  • Body format: JSON, with at least a return field.

Example response

{"return": 1}

return code

  • 1: Event created successfully, value may be the new event ID or success code.
  • 0: Missing required field.
  • -1: Cannot authenticate (invalid username/password).
  • -2: Don’t have permission to perform this action.
  • -3: Duplicate event report (event already reported).

Always check the return value in the response to determine whether the event was successfully created.

Copyright © 2009-2026 by Metamedia Technology. All rights reserved.