Avatar

isStopExceptionRequired cannot be null

0

I am trying to add a zone to my database using the SDK, I have tried using javascript and in the API Sandbox downloaded with the SDK and I keep getting the same error and I can't figure out how to fix it. I keep being told isStopExceptionRequired cannot be null even though I am specifying this to be true! I have tried a large variety of property combinations but nothing helps. The details I am putting into the sandbox are Method Name - Add, Paramaters

{"typeName": "Zone", "entity":{"name":"testname", "points":[{"x":136.89282,"y":-30.4894}, {"x":136.89532,"y":-30.48932}, {"x":136.89513,"y":-30.48637}, {"x":136.89278,"y":-30.4803}, {"x":136.89052,"y":-30.48111}, {"x":136.89272,"y":-30.48685}, {"x":136.89282,"y":-30.4894}], "isStopExceptionRequired": true, "fillColor":{"r": 255, "g": 69,  "b": 0, "a": 191}, "displayed":true}}

Is anyone able to help me? Thanks in advance.

Belinda Wallis

Please sign in to leave a comment.

2 comments

Avatar

Hi Belinda,

Thanks for pointing this out. This exception has an outdated message. IsStopExceptionRequired property has been changed to mustIdentifyStops. I'll fix this error message on our end. Sorry for any frustration this caused you.

I know you mentioned you tried many different combinations of properties so this is probably a result of that, but I wanted to point out that there are some properties missing from the Zone object that may be required.

I neat way to test/see a full zone object being added in raw JSON is to try the Unit Tests section of the SDK. If you navigate here, click Zone, sign in to your DB and click the API Methods and Tests tab, you can scroll through the methods to see what properties are being used and how the add method is structured. You can also open your browsers dev tools and run the test. The Console tab will show the test results and by looking in the Network monitor you can see the requests that are being made and the raw JSON content (as in the Add request). 

Here's a copy of what your JSON may look like with the correct properties:

"typeName" : "Zone",
"entity" : {
"name" : "testname",
"externalReference" : "",
"mustIdentifyStops" : true,
"displayed" : true,
"activeFrom" : "1986-01-01T00:00:00.000Z",
"activeTo" : "2050-01-01T00:00:00.000Z",
"zoneTypes" : ["ZoneTypeCustomerId"],
"fillColor" : {
"r" : 233,
"g" : 150,
"b" : 122,
"a" : 255
},
"points" : [{
"x" : 136.89282,
"y" : -30.4894
}, {
"x" : 136.89532,
"y" : -30.48932
}, {
"x" : 136.89513,
"y" : -30.48637
}, {
"x" : 136.89278,
"y" : -30.4803
}, {
"x" : 136.89052,
"y" : -30.48111
}, {
"x" : 136.89272,
"y" : -30.48685
}, {
"x" : 136.89282,
"y" : -30.4894
}
],
"groups" : [{
"id" : "GroupCompanyId"
}
]
}
}

Thanks,

Steve

0
Comment actions Permalink
Steve Hansen 0 votes
Avatar

Hi Steve,

 

Thanks for your help. I did manage to figure out the error message was actually referring to mustIdentifyStops and have managed to add a Zone in now. I did miss the unit tests though so I am sure they will come in handy!

Thanks again.

0
Comment actions Permalink
Belinda Wallis 0 votes