Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-19645

Hook-Script Get Content API has incorrect Header on the API doc

XMLWordPrintable

      Issue Summary

      We noted some inconsistency between the guide (https://developer.atlassian.com/server/bitbucket/rest/v810/api-group-system-maintenance/#api-api-latest-hook-scripts-scriptid-content-get) and command when run with the header Accept: application/json.

      Steps to Reproduce

      Follow the sample curl command given on the API document to get the content of the hook script as below:

      curl --request GET \
        --url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}/content' \
        --header 'Accept: application/json'
      

      Expected Results

      The command as per the API document should return the content of the hook script.

      Actual Results

      Testing out the command based on the API document and failed to get a response:

      pwaje@YDL91NPC6R ~ %   curl -k -u admin:password --request GET \
        --url 'https://dune/rest/api/latest/hook-scripts/2/content' \
        --header 'Accept: application/json'
      pwaje@YDL91NPC6R ~ % 
      

      However, it does work when I don't use the header Accept: application/json or use the header Content-Type: application/json

      pwaje@YDL91NPC6R ~ % curl -k -u admin:password --request GET \
        --url 'https://dune/rest/api/latest/hook-scripts/2/content'
      echo "You didn't say the magic word"
      exit 1
      pwaje@YDL91NPC6R ~ % 
      

      Workaround

      Run the command without the header Accept: application/json or use the header Content-Type: application/json

              69efaf67ab3e M Jin
              8c8205d742ae Priyata Waje
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: