Skip to content

Commit d43d078

Browse files
author
Paweł Maślak
committed
added X-APP-ID header
1 parent af59b87 commit d43d078

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

src/GetResponseAPI3.class.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,20 @@ class GetResponse
1515
private $api_key;
1616
private $api_url = 'https://api.getresponse.com/v3';
1717
private $timeout = 8;
18-
private $enterprise_domain = null;
1918
public $http_status;
2019

20+
/**
21+
* X-Domain header value if empty header will be not provided
22+
* @var string|null
23+
*/
24+
private $enterprise_domain = null;
25+
26+
/**
27+
* X-APP-ID header value if empty header will be not provided
28+
* @var string|null
29+
*/
30+
private $app_id = null;
31+
2132
/**
2233
* Set api key and optionally API endpoint
2334
* @param $api_key
@@ -353,6 +364,10 @@ private function call($api_method = null, $http_method = 'GET', $params = array(
353364
$options[CURLOPT_HTTPHEADER][] = 'X-Domain: ' . $this->enterprise_domain;
354365
}
355366

367+
if (!empty($this->app_id)) {
368+
$options[CURLOPT_HTTPHEADER][] = 'X-APP-ID: ' . $this->app_id;
369+
}
370+
356371
if ($http_method == 'POST') {
357372
$options[CURLOPT_POST] = 1;
358373
$options[CURLOPT_POSTFIELDS] = $params;

0 commit comments

Comments
 (0)