1 | <?php |
||
25 | class Contact extends AbstractResource |
||
26 | { |
||
27 | use AllTrait, CreateTrait, ViewTrait, UpdateTrait, DeleteTrait; |
||
28 | |||
29 | /** |
||
30 | * The resource endpoint |
||
31 | * |
||
32 | * @var string |
||
33 | * @internal |
||
34 | */ |
||
35 | protected $endpoint = '/contacts'; |
||
36 | |||
37 | /** |
||
38 | * List contact fields |
||
39 | * |
||
40 | * The agent whose credentials (API key or username/password) are being used to make this API call should be |
||
41 | * authorised to view the contact fields |
||
42 | * |
||
43 | * @api |
||
44 | * @param array|null $query |
||
45 | * @return array|null |
||
46 | * @throws \Freshdesk\Exceptions\AccessDeniedException |
||
47 | * @throws \Freshdesk\Exceptions\ApiException |
||
48 | * @throws \Freshdesk\Exceptions\AuthenticationException |
||
49 | * @throws \Freshdesk\Exceptions\ConflictingStateException |
||
50 | * @throws \Freshdesk\Exceptions\NotFoundException |
||
51 | * @throws \Freshdesk\Exceptions\RateLimitExceededException |
||
52 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException |
||
53 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException |
||
54 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException |
||
55 | * @throws \Freshdesk\Exceptions\ValidationException |
||
56 | */ |
||
57 | public function fields(array $query = null) |
||
61 | |||
62 | /** |
||
63 | * Convert a contact into an agent |
||
64 | * |
||
65 | * Note: |
||
66 | * 1. The contact must have an email address in order to be converted into an agent. |
||
67 | * 2. If your account has already reached the maximum number of agents, the API request will fail with HTTP error code 403 |
||
68 | * 3. The agent whose credentials (API key, username and password) were used to make this API call should be authorised to convert a contact into an agent |
||
69 | * |
||
70 | * @param int $id The agent id |
||
71 | * @param array|null $query |
||
72 | * @return array|null |
||
73 | * @throws \Freshdesk\Exceptions\AccessDeniedException |
||
74 | * @throws \Freshdesk\Exceptions\ApiException |
||
75 | * @throws \Freshdesk\Exceptions\AuthenticationException |
||
76 | * @throws \Freshdesk\Exceptions\ConflictingStateException |
||
77 | * @throws \Freshdesk\Exceptions\NotFoundException |
||
78 | * @throws \Freshdesk\Exceptions\RateLimitExceededException |
||
79 | * @throws \Freshdesk\Exceptions\UnsupportedContentTypeException |
||
80 | * @throws \Freshdesk\Exceptions\MethodNotAllowedException |
||
81 | * @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException |
||
82 | * @throws \Freshdesk\Exceptions\ValidationException |
||
83 | */ |
||
84 | public function makeAgent($id, array $query = null) |
||
90 | } |
||
91 |