Back to All

Mileage under PC or YM

Hello,

I'm successfully pulling up all daily logs through the https://api.samsara.com/fleet/hos/logs endpoint, going through them and separating the ones with Personal Conveyance and Yard Move duty statuses on them.

However, I can't find a way to pull mileage for each trip made under PC or YM since the response doesn't provide it.

Any idea how I can get the mileage driven during a PC or YM duty status?

Thank you!

Admin

Hi Steve,

We do have HOS Daily Logs endpoint (https://developers.samsara.com/reference/gethosdailylogs) which returns personalConveyanceDistanceMeters and yardMoveDistanceMeters in its response.

Yes, but that shows mileage under all trips made for that day combined.
I need mileage for each separate trip

Admin

Hi Steve,

We do not have an endpoint that gives this information directly but you could use the getHOSLogs endpoint(https://developers.samsara.com/reference/gethoslogs) to get the PC and YM startTime, endTime and vehicelID and pass this information onto our Vehicle Stats History endpoint (https://developers.samsara.com/reference/getvehiclestatshistory) to get the mileage for that trip

Marked as answered by Shivaram Gopalakrishnan

ο»Ώ