التقارير
إنشاء تقارير الأسطول بصيغتي PDF وExcel وإرسالها بالبريد الإلكتروني أو واتساب.
عنوان الأساسhttps://api.ping.nml.sa/v1عملية واحدة
الانتقال إلى عملية
إرسال تقرير الأسطول.
POST/v1/reports
Queues a fleet summary, trips, alarms or daily statistics report for a period, rendered as PDF or Excel and sent by email or WhatsApp to the recipients given. The response is the queued request; rendering and delivery follow asynchronously.
النطاقreports:write يقبل Idempotency-Key
المعاملات
Idempotency-KeystringالترويسةA unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.
محتوى الطلب
kindstringمطلوبfleet_summary: totals and distance per day and per vehicle; trips: each trip with its stops; alarms: alarms raised and how they were handled; daily_stats: distance, driving and idle hours per vehicle per day.
أحد:
fleet_summarytripsalarmsdaily_statsperiodobjectمطلوبCalendar days in Asia/Riyadh, both inclusive. At most 366 days, within the last five years, and not after today.
حقول period
fromstring (date)مطلوبمثال:
2026-11-09tostring (date)مطلوبمثال:
2026-11-15
vehicle_idsstring[]Vehicles to include. With neither vehicle_ids nor group_ids, every vehicle the key can see.
مثال:
["019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c"]group_idsstring[]Groups whose vehicles to include, limited to the vehicles the key can see.
مثال:
["019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8d"]formatstringpdf, or xlsx for Excel.
أحد:
pdfxlsxlanguagestringأحد:
arenrecipientsobject[]مطلوبمثال:
[{"email":"operations@example.com.sa"},{"contact_id":"019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c"}]حقول recipients
emailstringEmail address
مثال:
fahad@example.comcontact_idstringA contact of the account (accounts API).
مثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c
الاستجابة 202
idstringمثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8ckindstringfleet_summary: totals and distance per day and per vehicle; trips: each trip with its stops; alarms: alarms raised and how they were handled; daily_stats: distance, driving and idle hours per vehicle per day.
أحد:
fleet_summarytripsalarmsdaily_statsperiodobjectCalendar days in Asia/Riyadh, both inclusive. At most 366 days, within the last five years, and not after today.
حقول period
fromstring (date)مثال:
2026-11-09tostring (date)مثال:
2026-11-15
vehicle_idsstring[]group_idsstring[]formatstringpdf, or xlsx for Excel.
أحد:
pdfxlsxlanguagestringأحد:
arenrecipientsobject[]حقول recipients
emailstringEmail address
مثال:
fahad@example.comcontact_idstringA contact of the account (accounts API).
مثال:
019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c
statusstringأحد:
queuedrenderingsentfailedcreated_atstring (date-time)مثال:
2026-11-16T05:30:00Z
الأخطاء
400The request is invalid (code: invalid_request), with field errors.401The API key is missing, unknown, expired or revoked (code: unauthorized).403The API key lacks the scope this operation needs (code: forbidden).404No such resource in this account, or outside the key's data scope (code: not_found).429The key's rate limit is reached (code: rate_limited). Retry after the Retry-After header's seconds.
curl -X POST "https://api.ping.nml.sa/v1/reports" \
-H "Authorization: Bearer $PING_API_KEY" \
-H "Content-Type: application/json" \
-d '{"kind": "fleet_summary", "period": {"from": "2026-11-09", "to": "2026-11-15"}, "vehicle_ids": ["019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c"], "group_ids": ["019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8d"], "format": "pdf", "recipients": [{"email": "operations@example.com.sa"}, {"contact_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c"}]}'{
"id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c",
"kind": "fleet_summary",
"period": {
"from": "2026-11-09",
"to": "2026-11-15"
},
"vehicle_ids": [
"string"
],
"group_ids": [
"string"
],
"format": "pdf",
"language": "ar",
"recipients": [
{
"email": "fahad@example.com",
"contact_id": "019ac0c3-5e0d-7f2a-8b1c-3d4e5f6a7b8c"
}
],
"status": "queued",
"created_at": "2026-11-16T05:30:00Z"
}