I'm trying to disable fork in existing repo with below details using bitbucket API's:
1.
curl -X PUT \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/hooks' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
--data '{
"fork_policy": "no_forks"
}'
2.
curl --request PUT --user username:password --header "Content-Type: application/json" --data '{"fork_policy": "no_forks"}' https://api.bitbucket.org/2.0/repositories/workspace/repo_name
In both the cases, it is giving the same error: This endpoint does not support token-based authenticationcurl: (6) Could not resolve host: Bitbucket
I've tried by replacing PUT by POST but still not getting the result
I got the solution for above query:
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/workspace/repo_name' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{ "fork_policy": "no_forks" }'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.