action-factory.php
1 year ago
base-api-action.php
1 year ago
create-contact-action.php
1 year ago
get-custom-fields-action.php
1 year ago
get-lists-action.php
1 year ago
base-api-action.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace JFB_Modules\Actions_V2\Get_Response\Api; |
| 4 | |
| 5 | use JFB_Modules\Gateways\Base_Gateway_Action; |
| 6 | |
| 7 | class Base_Api_Action extends Base_Gateway_Action { |
| 8 | |
| 9 | private $api_key = ''; |
| 10 | |
| 11 | public function base_url(): string { |
| 12 | return 'https://api.getresponse.com/v3/'; |
| 13 | } |
| 14 | |
| 15 | public function action_headers() { |
| 16 | return array( |
| 17 | 'X-Auth-Token' => 'api-key ' . $this->get_api_key(), |
| 18 | 'Content-Type' => 'application/json', |
| 19 | ); |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @param string $api_key |
| 24 | */ |
| 25 | public function set_api_key( string $api_key ) { |
| 26 | $this->api_key = $api_key; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * @return string |
| 31 | */ |
| 32 | public function get_api_key(): string { |
| 33 | return $this->api_key; |
| 34 | } |
| 35 | |
| 36 | } |
| 37 |