tag:help.appveyor.com,2012-11-13:/discussions/problems/14775-build-api-fails-with-internal-server-error-500AppVeyor: Discussion 2018-10-19T08:18:49Ztag:help.appveyor.com,2012-11-13:Comment/455230152018-06-21T07:22:08Z2018-06-21T07:22:08ZBuild API fails with Internal Server Error 500<div><p>Here is a powershell script that works for me... Maybe it will give you some ideas<br></p>
<pre>
<code>$token = '<my-token>'
$headers = @{
"Authorization" = "Bearer $token"
"Content-type" = "application/json"
}
$body = @{
"accountName" = "<my-account-name>"
"projectSlug" = "<my-project>"
"branch" = "master"
"commitId" = "584ec7d9"
}
Invoke-RestMethod -Uri 'https://ci.appveyor.com/api/builds' -Headers $headers -Body ($body|ConvertTo-Json) -Method Post</code>
</pre></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/455230152018-06-21T07:25:14Z2018-06-21T07:25:14ZBuild API fails with Internal Server Error 500<div><p>Thanks! I was using Powershell as well but I missed the part where I should convert the body payload to json. My bad! Thanks a lot for the sample script. However it still would be nice if there was some kind of error message returned for a bad request :)</p></div>alexander