# instance not used with rest api and recording

**URL:** <https://community.wowza.com/t/instance-not-used-with-rest-api-and-recording/49131>\
**Category:** Wowza Developer Dojo\
**Tags:** recording\
**Created:** [July 6, 2017, 7:46am UTC](https://community.wowza.com/t/instance-not-used-with-rest-api-and-recording/49131 "2017-07-06T07:46:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriel\_Troisgros](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@Gabriel\_Troisgros](https://community.wowza.com/u/Gabriel_Troisgros)\
**Post date:** [July 6, 2017, 7:46am UTC](https://community.wowza.com/t/instance-not-used-with-rest-api-and-recording/49131/1 "2017-07-06T07:46:21Z")

</div>

Hello

it looks like specifying the instance name has no effect when starting to record using rest api. using this command will wait for a stream with name $streamName in instance _definst_ instead of the one specified in the variable $instanceName. bug or im doing something wrong ?

```auto
$sf = new com\wowza\Recording('wcs');

$recordName= $streamName;
$instanceName= ''.$_SESSION['roomID'].'';
$recorderState= "Waiting for stream";
$defaultRecorder= true;
$segmentationType= "None";
$outputPath= "/home/wcsrecordings/".$recordingID;
$baseFile= $streamName.".flv";
$fileFormat= "FLV"; // or FLV
$fileVersionDelegateName= "com.wowza.wms.livestreamrecord.manager.StreamRecorderFileVersionDelegate";
$fileTemplate= "${BaseFileName}_${RecordingStartTime}_${SegmentNumber}";
$segmentDuration= "900000";
$segmentSize= "10485760";
$segmentSchedule= "";
$recordData= true;
$startOnKeyFrame= true;
$splitOnTcDiscontinuity= false;
$option= "Version existing file";
$moveFirstVideoFrameToZero= true;
$currentSize= 0;
$currentDuration= 0;
$recordingStartTime = "";

$response = $sf->create($recordName, $instanceName, $recorderState, $defaultRecorder,
					$segmentationType, $outputPath, $baseFile, $fileFormat, $fileVersionDelegateName, $fileTemplate,
					$segmentDuration, $segmentSize, $segmentSchedule, $recordData, $startOnKeyFrame, $splitOnTcDiscontinuity,
					$option, $moveFirstVideoFrameToZero, $currentSize, $currentDuration, $recordingStartTime);
	

```
