Avatar

Add a zone in Js frontend give the error => Geotab.Serialization.JsonSerializerException

0

Hello!!

 

When I add a zone in javascript frontend , i have the following error => Geotab.Serialization.JsonSerializerException

Did somebody have a solution to fix/bypass that ??

 

my code is looking like that

var api = GeotabApi(function (authenticateCallback)
{

var server = "server",
userName = "userName",
password = "password",
database = "database";

authenticateCallback(server, database, userName, password, function (error)
{
//alert(error);
});

}, {
rememberMe: false
});

api.call("Add", {
"typeName": "Zone",
"entity": {
name: "xyz", 
activeFrom: "2019-01-17T21:09:00.000Z",
activeTo: "2019-01-17T21:29:00.000Z", 
displayed: true,
fillColor: { "r": 255, "g": 255, "b": 0, "a": 38 },
zoneTypes: ["ZoneTypeCustomerId"],
groups: [{ "color": { "a": 255, "b": 0, "g": 0, "r": 0 }, "id": "GroupCompanyId", "children": [], "comments": "", "reference": "" }],
mustIdentifyStops: true,
points: zonePoints
}
});

 

Thanks you !!! 

 

Patrick Begin

Please sign in to leave a comment.

3 comments

0
Avatar

Look at your name property in your request going out, looks like a JSON object instead of a string.

LP Papillon [d2go] 0 votes
0
Avatar

Hello Patrick,

In your JSON payload (from your screenshot) you seem to be sending a list of empty objects in your name property. This property should be a string as you had defined in your code. 

Wajih Qazi 0 votes