xcodecontinuous-integrationhttprequestxcode-serverxcode-bots

Xcode Server Bots API: Updating a bot with PATCH request


I would like to edit my Xcode bot through the Xcode Server API by sending the blueprint through PATCH.

However, when I send my PATCH request, Xcode Server replies back an unchanged json of my old blueprint.

My request is curl -X PATCH -H "Content-Type: application/json" -d "{\"my\": \"json\"}" https://<username>:<password>@<my_domain>:20343/api/bots/<bot_id>

What am I missing?


Solution

  • There are two missing parameters that will cause the following problems:

    Your final request should look like the following:

    curl -X PATCH -H "Content-Type: application/json" -H "x-xcsclientversion: 18" -d "{\"json goes\": \"here\"}" https://<username>:<password>@<domain>:20343/api/bots/<_id>?overwriteBlueprint=true

    Source: radar and Developer Relations (thanks!)