helpscout / helpscout-api-php

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

Adding example for automatically refreshing a token and trying again #238

Closed bkuhl closed 4 years ago

bkuhl commented 4 years ago

Ideally, the SDK internally would implement the ability to refresh automatically via a Guzzle middleware that would enable the automatic renewal of a refresh token when expired, then automatically retry the original request.

Since we don't have that, this pull request adds an example of how work can be retried today (originally suggested in https://github.com/helpscout/helpscout-api-php/issues/236#issuecomment-634153449).