Grep the access_token from response returned by bitbucket's oauth access_token endpoint. For example:
access_token
curl -s https://bitbucket.org/site/oauth2/access_token -d grant_type=client_credentials -u KEY:SECRET