Skip to content

Commit 9827432

Browse files
committed
use new sync API endpoints for job/task wait()
1 parent b084f2c commit 9827432

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/Resources/JobsResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function refresh(Job $job, $query = null): Job
8181
*/
8282
public function wait(Job $job): Job
8383
{
84-
$response = $this->httpTransport->get($this->httpTransport->getBaseUri() . '/jobs/' . $job->getId() . '/wait');
84+
$response = $this->httpTransport->get($this->httpTransport->getSyncBaseUri() . '/jobs/' . $job->getId());
8585
return $this->hydrator->hydrateObjectByResponse($job, $response);
8686
}
8787

src/Resources/TasksResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function refresh(Task $task, $query = null): Task
7878
*/
7979
public function wait(Task $task): Task
8080
{
81-
$response = $this->httpTransport->get($this->httpTransport->getBaseUri() . '/tasks/' . $task->getId() . '/wait');
81+
$response = $this->httpTransport->get($this->httpTransport->getSyncBaseUri() . '/tasks/' . $task->getId());
8282
return $this->hydrator->hydrateObjectByResponse($task, $response);
8383
}
8484

src/Transport/HttpTransport.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ public function getBaseUri(): string
7373
return $this->options['sandbox'] ? 'https://api.sandbox.cloudconvert.com/v2' : 'https://api.cloudconvert.com/v2';
7474
}
7575

76+
/**
77+
* @return string
78+
*/
79+
public function getSyncBaseUri(): string
80+
{
81+
return $this->options['sandbox'] ? 'https://sync.api.sandbox.cloudconvert.com/v2' : 'https://sync.api.cloudconvert.com/v2';
82+
}
83+
7684
/**
7785
* @return HttpClient
7886
*/

0 commit comments

Comments
 (0)