Skip to content

Commit 9359c05

Browse files
authored
Merge pull request #5 from luqman7/survey
endpoints for csat
2 parents d65b6cf + 4f80e91 commit 9359c05

2 files changed

Lines changed: 45 additions & 1 deletion

File tree

src/Api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class Api
198198
* @var Client
199199
*/
200200
protected $client;
201-
201+
202202
/**
203203
* @internal
204204
* @var string

src/Resources/Ticket.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,4 +183,48 @@ public function createWithAttachment(array $data)
183183
{
184184
return $this->api()->requestMultipart('POST', $this->endpoint(), $data);
185185
}
186+
187+
/**
188+
* Create a satisfaction rating
189+
*
190+
* @param int $id The ticket id
191+
* @param array $data
192+
* @return mixed|null
193+
* @throws \Freshdesk\Exceptions\AccessDeniedException
194+
* @throws \Freshdesk\Exceptions\ApiException
195+
* @throws \Freshdesk\Exceptions\AuthenticationException
196+
* @throws \Freshdesk\Exceptions\ConflictingStateException
197+
* @throws \Freshdesk\Exceptions\NotFoundException
198+
* @throws \Freshdesk\Exceptions\RateLimitExceededException
199+
* @throws \Freshdesk\Exceptions\UnsupportedContentTypeException
200+
* @throws \Freshdesk\Exceptions\MethodNotAllowedException
201+
* @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException
202+
* @throws \Freshdesk\Exceptions\ValidationException
203+
*/
204+
public function survey($id, array $query = null)
205+
{
206+
return $this->api()->request('POST', $this->endpoint($id.'/satisfaction_ratings'), $query);
207+
}
208+
209+
/**
210+
* List all satisfaction ratings on ticket
211+
*
212+
* @param int $id The ticket id
213+
* @param array $data
214+
* @return mixed|null
215+
* @throws \Freshdesk\Exceptions\AccessDeniedException
216+
* @throws \Freshdesk\Exceptions\ApiException
217+
* @throws \Freshdesk\Exceptions\AuthenticationException
218+
* @throws \Freshdesk\Exceptions\ConflictingStateException
219+
* @throws \Freshdesk\Exceptions\NotFoundException
220+
* @throws \Freshdesk\Exceptions\RateLimitExceededException
221+
* @throws \Freshdesk\Exceptions\UnsupportedContentTypeException
222+
* @throws \Freshdesk\Exceptions\MethodNotAllowedException
223+
* @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException
224+
* @throws \Freshdesk\Exceptions\ValidationException
225+
*/
226+
public function listSurvey($id, array $query = null)
227+
{
228+
return $this->api()->request('GET', $this->endpoint($id.'/satisfaction_ratings'), $query);
229+
}
186230
}

0 commit comments

Comments
 (0)