-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathIntercomMessages.php
More file actions
63 lines (57 loc) · 1.65 KB
/
IntercomMessages.php
File metadata and controls
63 lines (57 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
namespace Intercom;
use Http\Client\Exception;
use stdClass;
class IntercomMessages extends IntercomResource
{
/**
* Creates Message.
*
* @see https://developers.intercom.io/reference#conversations
* @param array $options
* @return stdClass
* @throws Exception
*/
public function create($options)
{
return $this->client->post("messages", $options);
}
/**
* Creates Message Export Job
*
* @see https://developers.intercom.com/intercom-api-reference/reference#creating-an-export-job
* @param array $options
* @return stdClass
* @throws Exception
*/
public function createExport($options)
{
return $this->client->post("export/messages/data", $options);
}
/**
* Retrieves Export Job Status
*
* @see https://developers.intercom.com/intercom-api-reference/reference#checking-the-status-of-the-job
* @param string $job_identifier
* @return stdClass
* @throws Exception
*/
public function retrieveExportStatus($job_identifier)
{
return $this->client->get("export/messages/data/" . $job_identifier, []);
}
/**
* Retrieves Export Job Data
*
* Important: The Intercom Client Accept Header must be application/octet-stream
*
* @see https://developers.intercom.com/intercom-api-reference/reference#downloading-the-data
* @param string $job_identifier
* @return stdClass
* @throws Exception
*/
public function retrieveExportData($job_identifier)
{
return $this->client->get("download/messages/data/" . $job_identifier, []);
}
}