0

i created bitbucket webhook api call supplied it with secret the secret token not generate.how to set secret ?. i have use requests methods

def create_hook(workspace_id):
    # Build the URL for the workspace webhooks endpoint
    url = f'https://api.bitbucket.org/2.0/workspaces/{workspace_id}/hooks'

    auth = ("user_name", "password")
    data = {
        'url': 'https://demourl.com',
        "name": "wehhook test secret",
        "description": " new webhook test ",
        'active': True,
        'events': [
            "pullrequest:approved", "repo:commit_comment_created",
        ],
        "configuration": {
            "secret": "abcdef",

        }

    }
     # end the HTTP request to create the webhook
    response = requests.post(url, json=data, auth=auth)
    if response.status_code == 201:
        return response.json()
    else:
        print("failed to create webhook", response.text)
        return {}```

i want to secret token will generated ,how add secret in bitbucket webhook

0 Answers0