I want to access my Bitbucket Cloud workspace data using the GraphQL API, but I am getting an error that says "Auth category: API_TOKEN is not allowed in service bitbucket". The error message also says that only session-based authentication is allowed.
i am calling this endpoint
https://api.atlassian.com/graphql - POST
graphql query:
query Bitbucket {
bitbucket {
bitbucketRepositories(ids: [""]) {
id
name
href
}
}
}
and for authentication i am passing token in header:
{
"Authorization" : "Basic base64<email:token>"
}
but this query does not allow token authentication
Response:
{
"message": "Auth category: API_TOKEN is not allowed in service bitbucket",
"locations": [],
"extensions": {
"allowedAuth": [
"SESSION"
],
"presentedAuth": "API_TOKEN",
"classification": "IncorrectAuthException",
"aggUgcPiiSafe": true,
"errorSource": "GRAPHQL_GATEWAY"
}
}
so please anyone can help me out how to do session based authentication?
and also need help for followings:
What GraphQL queries can I use to get the following data:
1. get repo list
2. particular repo branch list
3. get particular repo pull requests
4. get particular repo commits
5. get particular repo all files content
Thanks