I used bitbucket downloads REST API using curl.
curl -X POST --user <span>"${BB_AUTH_STRING}"</span> <span>"<a href="https://api.bitbucket.org/2.0/repositories/%24%7BBITBUCKET_REPO_OWNER%7D/%24%7BBITBUCKET_REPO_SLUG%7D/downloads" target="_blank" rel="nofollow noopener noreferrer">https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads</a>"</span> --form files<span>=</span>@<span>"target/output.jar"</span>
But the problem is that I am getting anonymous errors
<span>"You can try again or contact support if the problem persists"</span>
<span>Is there any way to get detailed error report to fix the problem? </span>