Skip to content

Instantly share code, notes, and snippets.

@IlyaFinkelshteyn
Last active March 29, 2019 08:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IlyaFinkelshteyn/fca312491c2363625095cbc7c5f80ab9 to your computer and use it in GitHub Desktop.
Save IlyaFinkelshteyn/fca312491c2363625095cbc7c5f80ab9 to your computer and use it in GitHub Desktop.
PowerShell sample:
$token = "" # token from https://ci.appveyor.com/api-token
$accountName = "" # account name from project IRL (after project/")
$projectSlug = "" # project slug from project IRL (after account)
$headers = @{
"Authorization" = "Bearer $token"
"Content-type" = "application/json"
}
Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/$accountName/$projectSlug/buildcache" -Headers $headers -Method DELETE
Curl sample:
set token=""
set accountName=""
set projectSlug=""
curl -X "DELETE" "https://ci.appveyor.com/api/projects/%accountName%/%projectSlug%/buildcache" -H "Content-type: application/json" -H "Authorization: Bearer %token%" --insecure
@sschuberth
Copy link

Small remark, the URL should be https://ci.appveyor.com/api-keys instead of https://ci.appveyor.com/api-token.

@sschuberth
Copy link

sschuberth commented Mar 29, 2019

And in the cURL example the variables must be defined without set and expanded via $, not %...%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment