code: private function getTokenFromResponse(array $data): string
      {
          $url = $data['nextSyncUrl'] ?? $data['nextPageUrl'];
  
          $queryValues = [];
          \parse_str(\parse_url($url, \PHP_URL_QUERY), $queryValues);
  
          return $queryValues['sync_token'];
      }
docs: Parses the sync_token out of an URL supplied by the API.
  
  @param array $data The API response
  
  @return string