ข้ามไปยังเนื้อหาหลัก
RKoon-1279
ผู้โพสต์ต้นฉบับ

Does anyone have issues getting Driver Violations from the API and only giving verified violations and not the ones that are unverified? We are getting them 10 hours late in the API and seems like it's when the driver is verifying the logs.

 

Thoughts?

เข้าร่วมการสนทนา

You need to be logged in to reply to this post and participate in the Geotab Community discussions.

คำตอบที่ดีที่สุด

jpaz-1560
จีโอแท็บเบอร์

Hi @RKoon-1279​ ,

Thanks for sharing your API call. One thing that I noticed is that you're using carrierNumber as a search property, you will need to perform the search by one of the supported search properties for this API call (id, companyGroups, driverGroups), you can find more details by reviewing the DutyStatusViolationSearch reference

{ "method": "Get", "params": { "search": { "userSearch": { "id": "USER_ID" }, "fromdate": "2022-02-03T13:26:49" }, "typeName": "DutyStatusViolation", "credentials": { "database": "mydatabase", "path": "ThisServer", "sessionId": "mysessionid", "userName": "myusername" } } }

 

 

I was able to retrieve unverified violations right after they were triggered via the API with my test device.

 

The way in which violations are triggered depend on the type of the violation and the ruleset that the driver has configured, you can review the specifics for each rule set by following this link.

 

If you're still presenting problems, feel free to reach out to me via email with the specific details and we can go over the specifics of your API call and current results.

 

 

 

9 การตอบกลับ

EishiFUN
ผู้ดูแลชุมชน

Hey @RKoon-1279​ ,

 

Thank you for asking your question in our community. I have contacted our SDK subject matter experts for their advice in this situation. Someone should be jumping in soon.

 

If you have any additional questions in the meantime please send them or if you end up finding the answer we would love to know.

 

Have a great day!

Eishi FUN

jpaz-1560
จีโอแท็บเบอร์

Hi @RKoon-1279​,

Can you share the API call(s) that you're currently using so that we can review it.

RKoon-1279
ผู้โพสต์ต้นฉบับ

Here you go.

 

{ "method": "Get", "params": { "search": { "userSearch": { "carrierNumber": "ourcarrier#" }, "fromdate": "2022-02-03T13:26:49" }, "typeName": "DutyStatusViolation", "credentials": { "database": "mydatabase", "path": "ThisServer", "sessionId": "mysessionid", "userName": "myusername" } } }

 

jpaz-1560
จีโอแท็บเบอร์

Hi @RKoon-1279​ ,

Thanks for sharing your API call. One thing that I noticed is that you're using carrierNumber as a search property, you will need to perform the search by one of the supported search properties for this API call (id, companyGroups, driverGroups), you can find more details by reviewing the DutyStatusViolationSearch reference

{ "method": "Get", "params": { "search": { "userSearch": { "id": "USER_ID" }, "fromdate": "2022-02-03T13:26:49" }, "typeName": "DutyStatusViolation", "credentials": { "database": "mydatabase", "path": "ThisServer", "sessionId": "mysessionid", "userName": "myusername" } } }

 

 

I was able to retrieve unverified violations right after they were triggered via the API with my test device.

 

The way in which violations are triggered depend on the type of the violation and the ruleset that the driver has configured, you can review the specifics for each rule set by following this link.

 

If you're still presenting problems, feel free to reach out to me via email with the specific details and we can go over the specifics of your API call and current results.

 

 

 

RKoon-1279
ผู้โพสต์ต้นฉบับ

I noticed that too after I posted it, however, it was giving me all the data for everyone in that specific date range from until current. I do just want to get them all in one call. Can I do that?

 

jpaz-1560
จีโอแท็บเบอร์

Yes, you should be able to do it by supplying an empty userSearch object.

RKoon-1279
ผู้โพสต์ต้นฉบับ

I did it like this and did not get anything back. I know there are a few violations but nothing shows up.

Ideas?

 

 

{ "method": "Get", "params": { "search": { "userSearch": { "id": "" }, "fromdate": "2022-02-06T00:26:49" }, "typeName": "DutyStatusViolation", "credentials": { "database": "mydatabase", "path": "ThisServer", "sessionId": "mysessionid", "userName": "myusername" } } }

 

jpaz-1560
จีโอแท็บเบอร์

Adding the id as empty will return no results. You need to just send the object as empty ("userSearch": {}), try using it like this:

{ "method": "Get", "params": { "search": { "userSearch": {}, "fromdate": "2022-02-06T00:26:49" }, "typeName": "DutyStatusViolation", "credentials": { "database": "mydatabase", "path": "ThisServer", "sessionId": "mysessionid", "userName": "myusername" } } }

 

RKoon-1279
ผู้โพสต์ต้นฉบับ

ahhh. gotcha. I knew that. More coffee please...lol Thanks a million. I will do it this way.

ยังมีคำถามอีกไหม