lib/Github/Api/Apps.php
public function createInstallationToken($installationId, $userId = null)
    {
        $parameters = [];
        if ($userId) {
            $parameters['user_id'] = $userId;
        }

        return $this->post('/app/installations/'.rawurlencode($installationId).'/access_tokens', $parameters);
    }
public function createInstallationToken($installationId, $userId = null)
    {
        $parameters = [];
        if ($userId) {
            $parameters['user_id'] = $userId;
        }

        return $this->post('/app/installations/'.rawurlencode($installationId).'/access_tokens', $parameters);
    }
public function createInstallationToken ( $ installationId , $ userId = null ) { $ parameters = [ ] ; if ( $ userId ) { $ parameters [ 'user_id' ] = $ userId ; } return $ this -> post ( '/app/installations/' . rawurlencode ( $ installationId ) . '/access_tokens' , $ parameters ) ; }
Create an access token for an installation.

@param int $installationId An integration installation id
@param int $userId         An optional user id on behalf of whom the
token will be requested

@link https://developer.github.com/v3/apps/#create-a-new-installation-token

@return array token and token metadata
Create an access token for an installation .