How to enable this hook with using rest api

Issue #30 resolved
Alan Yang created an issue

Reference /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled, I want to enable this hook with using rest api. How to add configuration? Is there document?

Comments (4)

  1. Alan Yang reporter

    Now I have enabled hook with request body reference from source atlassian-plugin.xml:

    {"method": "PUT", "url": "http://xxx.com"}
    

    But method do not change.

  2. Alexander Renteln

    Hi Alan,

    as described in the Atlassian REST API documentation

    curl 'https://host/bitbucket/rest/api/latest/projects/PRO1/repos/repo1/settings/hooks/de.aeffle.stash.plugin.stash-http-get-post-receive-hook%3Ahttp-get-post-receive-hook/enabled' -X PUT [...]  --data-binary '{"version":"3","locationCount":"1","httpMethod":"GET","url":"https://google.com","useAuth":true,"user":"test","pass":"test","postContentType":"application/x-www-form-urlencoded","branchFilter":"","tagFilter":"","userFilter":""}'
    

    Best, Alex

  3. Log in to comment