def get_access_token(self, installation_id, user_id=None):
body = {}<EOL>if user_id:<EOL><INDENT>body = {"<STR_LIT>": user_id}<EOL><DEDENT>response = requests.post(<EOL>"<STR_LIT>".format(installation_id),<EOL>headers={<EOL>"<STR_LIT>": "<STR_LIT>".format(self.create_jwt()),<EOL>"<STR_LIT>": Consts.mediaTypeIntegrationPreview,<EOL>"<STR_LIT>": "<STR_LIT>"<EOL>},<EOL>json=body<EOL>)<EOL>if response.status_code == <NUM_LIT>:<EOL><INDENT>return InstallationAuthorization.InstallationAuthorization(<EOL>requester=None,  <EOL>headers={},  <EOL>attributes=response.json(),<EOL>completed=True<EOL>)<EOL><DEDENT>elif response.status_code == <NUM_LIT>:<EOL><INDENT>raise GithubException.BadCredentialsException(<EOL>status=response.status_code,<EOL>data=response.text<EOL>)<EOL><DEDENT>elif response.status_code == <NUM_LIT>:<EOL><INDENT>raise GithubException.UnknownObjectException(<EOL>status=response.status_code,<EOL>data=response.text<EOL>)<EOL><DEDENT>raise GithubException.GithubException(<EOL>status=response.status_code,<EOL>data=response.text<EOL>)<EOL>
Get an access token for the given installation id.
POSTs https://api.github.com/app/installations/<installation_id>/access_tokens
:param user_id: int
:param installation_id: int
:return: :class:`github.InstallationAuthorization.InstallationAuthorization`