Using the TeamCity REST API to update the name and description of a project
Hello,
I'd like to update the name of a project with id MyProduct_MySample to "Sample". Reading the documentation it seems I only have to send text to http://teamcity.example.com/httpAuth/app/rest/projects/id:MyProduct_MySample/name as follows:
curl -X PUT \
http://teamcity.example.com/httpAuth/app/rest/projects/id:MyProduct_MySample/name \
-H 'accept: application/xml' \
-H 'authorization: Basic blablabla' \
-H 'cache-control: no-cache' \
-H 'content-type: text/plain' \
-H 'origin: http://teamcity.example.com' \
-d Sample
But when I do, I get the following error:
Responding with error, status code: 406 (Not Acceptable).
Details: javax.ws.rs.WebApplicationException
Not supported request. Check that URL, HTTP method and transferred data are correct.
How does one update the name of a project?
Werner
Please sign in to leave a comment.
You can update the name of the project using 2 different curl commands with different URL.
To update the project name:
curl -u username:password -X PUT -d 'newProjectName' -H 'Content-Type:text/plain' http://teamcity.example.com/app/rest/projects/id:TestProject1/name
To update the description:
curl -u username:password -X PUT -d 'newProjectDescription' -H 'Content-Type:text/plain' http://teamcity.example.com/app/rest/projects/id:TestProject1/description