Cast exception when trying to call StartStopRecording

I’m trying to call StartStopRecording through the WebAPI using the following url http://ip:8124/Json/StartStopRecording?sourceId=0&enabled=1&authToken=2 using both curl and the python requests library but get a cast exception error returned to me. I’ve verified I can call GetCameras and get a valid response to make sure my authkey wasn’t the problem and I’ve also tried calling StartStopRecording without enabled and/or sourceId and get an Access Denied message as expected as it’s not a complete path. Here’s the message:

      <p>The server encountered an error processing the request. The exception message is 'Specified cast is not valid.'. See server logs for more details. The exception stack trace is: </p>
      <p>   at SyncInvokeStartStopRecording(Object , Object[] , Object[] )
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</p>```

Any ideas would be greatly appreciated as this was working for a few months and has suddenly stopped.

“Suddenly stooped”. Can you please describe a little bit more. Was it an update of windows or was it an update of NCS or … everything is of interest. Also, run the latest version of NCS.


try with enabled=true instead of enabled=1 this is probably where the cast problem is coming from.