@@ -181,6 +181,7 @@ try {
181181 ]);
182182}
183183
184+
184185/*
185186 * Example: Start Automation360 event
186187 */
@@ -207,5 +208,72 @@ try {
207208 ]);
208209}
209210
211+
212+ /**
213+ * Example: Crm create a new deal
214+ */
215+ try {
216+ $crmCreateDeal = $apiClient->post('crm/v1/deals', [
217+ "pipelineId" => 0,
218+ "stepId" => 0,
219+ "responsibleId" => 0,
220+ "name" => "string",
221+ "price" => 0,
222+ "currency" => "string",
223+ "sourceId" => 0,
224+ "contact" => [
225+ 0
226+ ],
227+ "attributes" => [
228+ [
229+ "attributeId" => 0,
230+ "value" => "string"
231+ ]
232+ ],
233+ "attachments" => [
234+ "https://link-to-file.com/file.jpg"
235+ ]
236+ ]);
237+
238+ var_dump($crmCreateDeal);
239+ } catch (ApiClientException $e) {
240+ var_dump([
241+ 'message' => $e->getMessage(),
242+ 'http_code' => $e->getCode(),
243+ 'response' => $e->getResponse(),
244+ 'curl_errors' => $e->getCurlErrors(),
245+ 'headers' => $e->getHeaders()
246+ ]);
247+ }
248+
249+
250+ /**
251+ * Example: Whatsapp send a template message to the specified contact
252+ */
253+ try {
254+ $crmCreateDeal = $apiClient->post('whatsapp/contacts/sendTemplateByPhone', [
255+ "bot_id" => "xxxxxxxxxxxxxxxxxxxxxxxx",
256+ "phone" => "380931112233",
257+ "template" => [
258+ "name" => "thanks_for_buying",
259+ "language" => [
260+ "code" => "en"
261+ ],
262+ "components" => []
263+ ]
264+ ]);
265+
266+ var_dump($crmCreateDeal);
267+ } catch (ApiClientException $e) {
268+ var_dump([
269+ 'message' => $e->getMessage(),
270+ 'http_code' => $e->getCode(),
271+ 'response' => $e->getResponse(),
272+ 'curl_errors' => $e->getCurlErrors(),
273+ 'headers' => $e->getHeaders()
274+ ]);
275+ }
276+
277+
210278```
211279
0 commit comments