Skip to content

Commit

Permalink
add archive/unarchive a call
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-volga authored Jan 3, 2024
1 parent b76c106 commit a8467f1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/AircallCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,37 @@ public function addInsightCards(int $id, array $options = [])
return $this->client->post($path.'/insight_cards', $options);
}

/**
* Archive a Call
* @see https://developer.aircall.io/api-references/#archive-a-call
*
* @throws GuzzleException
*
* @return mixed
*/
public function archive(int $id)
{
$path = $this->callPath($id);

return $this->client->put($path.'/archive');
}

/**
* Unarchive a Call
* @see https://developer.aircall.io/api-references/#unarchive-a-call
*
* @throws GuzzleException
*
* @return mixed
*/
public function archive(int $id)
{
$path = $this->callPath($id);

return $this->client->put($path.'/unarchive');
}


public function callPath(int $id): string
{
return self::BASE_ENDPOINT.'/'.$id;
Expand Down

0 comments on commit a8467f1

Please sign in to comment.