What API do I use to add a manifest/Load number to the drivers logs? We want to do this for the driver so they do not have to add it themselves.
Thoughts?
Edited by Genevieve-1051
What API do I use to add a manifest/Load number to the drivers logs? We want to do this for the driver so they do not have to add it themselves.
Thoughts?
You need to be logged in to reply to this post and participate in the Geotab Community discussions.
Hi @RKoon-1279 ,
Please try the following:
{
"method": "Add",
"params": {
"typeName": "ShipmentLog",
"entity": {
"dateTime": "2020-01-02T13:27:44",
"driver": {
"id": "b#"
},
"device": {
"id": "b#"
},
"activeFrom": "2020-01-02T13:30:00",
"shipperName": " Test",
"documentNumber": "123456",
"commodity": "test comod"
},
"credentials": {
"database": "db name",
"sessionId": "session id",
"userName": "user name"
}
}
}I made the following changes here:
I sent a post request to https://[myserver]/apiv1 ([myserver] will be replaced by myxx.geotab.com)
Please let me know if you continue to run into any more issues.
Edited by RKoon-1279
ok I think I figured it out but have an issue with the Json. Anyone help with this please?
I got this off the developer discussions
{
"method": "Add",
"entity": {
"dateTime": "2020-12-30T11:27:44",
"driver": {
"id": "##"
},
"device": {
"id": "##"
},
"activeFrom": "2020-12-30T11:30:00",
"shipperName": " Test",
"documentNumber": "123456",
"commodity": "test comod",
"typeName": "ShipmentLog",
"credentials": {
"database": "mydatabase",
"path": "ThisServer",
"sessionId": "mysessionid",
"userName": "myemail"
}
}
}Gives me this error
{
"error": {
"message": "The method 'Add' could not be found. Verify the method name and ensure all method parameters are included.",
"code": -32601,
"data": {
"id": "some id",
"type": "MissingMethodException",
"requestIndex": 0
},
"name": "JSONRPCError",
"errors": [
{
"message": "The method 'Add' could not be found. Verify the method name and ensure all method parameters are included.",
"name": "MissingMethodException"
}
]
},
"jsonrpc": "2.0",
"requestIndex": 0
}
Hi @RKoon-1279 ,
Glad you found a great clue in an older discussion :) Looking at that example, I see your API call's brackets aren't setup the same way, which impacts the logic. Can you try adjusting to match the example you shared and see if that helps? e.g. typeName and entity should be bracketed within the Add method, but typeName shouldn't be within entity. Let me know if that helps!
it still does not work.. Here is what I got. I'm even trying in postman to get it to work. If I can get that then I can code the other. Any ideas?
{
"method": "Add",
"typeName":"ShipmentLog",
"entity": {
"dateTime": "2020-12-30T11:27:44",
"driver": {
"id": "b#"
},
"device": {
"id": "b##"
},
"activeFrom": "2020-12-30T11:30:00",
"shipperName": " Test",
"documentNumber": "123456",
"commodity": "test comod",
"credentials": {
"database": "mydatabase",
"path": "ThisServer",
"sessionId": "mysessionid",
"userName": "myemail"
}
}
}
Hi @RKoon-1279 ,
Please try the following:
{
"method": "Add",
"params": {
"typeName": "ShipmentLog",
"entity": {
"dateTime": "2020-01-02T13:27:44",
"driver": {
"id": "b#"
},
"device": {
"id": "b#"
},
"activeFrom": "2020-01-02T13:30:00",
"shipperName": " Test",
"documentNumber": "123456",
"commodity": "test comod"
},
"credentials": {
"database": "db name",
"sessionId": "session id",
"userName": "user name"
}
}
}I made the following changes here:
I sent a post request to https://[myserver]/apiv1 ([myserver] will be replaced by myxx.geotab.com)
Please let me know if you continue to run into any more issues.