# Stream recorder status API REST call gives wrong result

**URL:** <https://community.wowza.com/t/stream-recorder-status-api-rest-call-gives-wrong-result/45365>\
**Category:** Wowza Developer Dojo\
**Created:** [January 29, 2016, 5:15am UTC](https://community.wowza.com/t/stream-recorder-status-api-rest-call-gives-wrong-result/45365 "2016-01-29T05:15:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuel\_Oliva](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@Manuel\_Oliva](https://community.wowza.com/u/Manuel_Oliva)\
**Post date:** [January 29, 2016, 5:15am UTC](https://community.wowza.com/t/stream-recorder-status-api-rest-call-gives-wrong-result/45365/1 "2016-01-29T05:15:51Z")

</div>

Hi,

I am using the Wowza API REST in order to record a live stream.

```auto
curl -X POST http://myhost:8087/v2/servers/_defaultServer_ /vhosts/_defaultVHost_/applications/test/instances/_definst_/streamrecorders/live 
-d '
{
 "restURI":"http://myhost:8087/v2/servers/_defaultServer_ /vhosts/_defaultVHost_/applications/test/instances/_definst_/streamrecorders/live",
 "recorderName":"live",
"instanceName":"_definst_",
"defaultRecorder":true,
"segmentationType":"None",
"outputPath": "",
"baseFile":"Test.flv",
"fileFormat":"FLV",
"fileVersionDelegateName":"com.wowza.wms.livestreamrecord.manager.StreamRecorderFileVersionDelegate",
"fileTemplate":"${BaseFileName}_${RecordingStartTime}_${SegmentNumber}",
"segmentDuration":900000,
"segmentSize":10485760,
"segmentSchedule":"0 * * * * *",
"recordData":true,
"startOnKeyFrame":true,
"option":"Overwrite existing file",
"moveFirstVideoFrameToZero":true,
"currentSize":0,
"currentDuration":0,
"recordingStartTime":""
}'

```

Immediately I request the status of the stream recorder:

```auto
curl -X GET http://myhost:8087/v2/servers/_defaultServer_ /vhosts/_defaultVHost_/applications/test/instances/_definst_/streamrecorders/live

```

In most of the cases although the incoming stream is active, Wowza API response has recorderState field as “Waiting for stream”.

```auto
{"recorderName":"live","instanceName":"_definst_","recorderState":"Waiting for stream","defaultRecorder":false,"segmentationType":"None","outputPath":"","baseFile":"Test.flv","fileFormat":"FLV","fileVersionDelegateName":"com.wowza.wms.livestreamrecord.manager.StreamRecorderFileVersionDelegate","fileTemplate":"${BaseFileName}","segmentDuration":0,"segmentSize":10485760,"segmentSchedule":"0 * * * * *","recordData":true,"startOnKeyFrame":true,"option":"Overwrite existing file","moveFirstVideoFrameToZero":true,"currentSize":0,"currentDuration":0,"recordingStartTime":""}

```

This status (“Waiting for stream”) is returned when the incoming stream of the stream recorder does not exist, so in my opinion recorderState could not be “Waiting for stream” when the incoming stream is active.

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [February 3, 2016, 8:49am UTC](https://community.wowza.com/t/stream-recorder-status-api-rest-call-gives-wrong-result/45365/2 "2016-02-03T08:49:11Z")

</div>

Hello

In your examples I would ensure that you include your headers into your request and ensure the stream name and application are in fact matching the active stream. For example, I took your request and setup the same scenario. I published a stream name “live” to an application named “test” and after publishing to it, I used the following query:

```auto
curl -X POST --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/test/instances/_definst_/streamrecorders/live -d '
{
 "restURI":"http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/test/instances/_definst_/streamrecorders/live",
 "recorderName":"live",
"instanceName":"_definst_",
"recorderState":"Waiting for stream",
"defaultRecorder":true,
"segmentationType":"None",
"outputPath":"/Library/WowzaStreamingEngine/content/",
"baseFile":"myrecord2.mp4",
"fileFormat":"MP4",
"fileVersionDelegateName":"com.wowza.wms.livestreamrecord.manager.StreamRecorderFileVersionDelegate",
"fileTemplate":"${BaseFileName}_${RecordingStartTime}_${SegmentNumber}",
"recordData":true,
"startOnKeyFrame":true,
"option":"Version existing file",
"moveFirstVideoFrameToZero":true,
"currentSize":0,
"currentDuration":0,
"recordingStartTime":""
}'

```

And received the following response:

```auto
{"success":true,"message":"Recorder Created","data":null}

```

Thereafter I completed a GET against the stream recorder (for the stream) as follows:

```auto
curl -X GET --header 'Accept:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/test/instances/_definst_/streamrecorders/live

```

This did show it was in progress:

```auto
{"serverName":"_defaultServer_","recorderName":"live","instanceName":"_definst_","recorderState":"Recording in Progress" ..... "recordingStartTime":"2016-02-03-08.48.17.699--05:00"}

```

Should you continue to have problems, please do the following:

1. Restart Wowza

2. Publish your stream

3. Initiate the recorder (via api) as mentioned above

4. Do a GET thereafter.

Then copy and paste both cURL commands and zip up your conf/ and logs/ directories and send them via our support form [here](https://www.wowza.com/portal/help/engine).

Thanks,

Matt
