helpscout / helpscout-api-php

PHP Wrapper for the Help Scout API
MIT License
98 stars 62 forks source link

Additional headers #203

Closed bkuhl closed 4 years ago

bkuhl commented 4 years ago

Targets a new 1.9.6 release (up from 1.9.5)

Problem

Mailbox API v1 and PHP SDK v1 are deprecated and being shut down. There is a scenario where to assist with transition, some folks need to be able to specify custom headers when interacting with v1 of the API.

Solution

Headers can be specified statically using:

ApiClient::setAdditionalHeaders([
    'foo' => 'bar',
]);

... which will then be appended to all requests to our API. No breaking changes are introduced.

anthonyterrell commented 4 years ago

Normally I'd mention the inconsistent spacing but I think the assumption is to do as little work as possible since this is deprecated. Nice solution 😄

bkuhl commented 4 years ago

I didn't even notice that. Oh well, it's deprecated :)