Github allows users to interact with their online profile (account details, repo details etc) via several APIs separate from the standard web-interface. This proves useful, if, say, you need to remove a problematic repo entirely from Github, and the web interface won’t let you access the repo page, citing error: page not found
.
From the instructions given:
$ curl -F 'login=ootput' -F 'token=_API_TOKEN_HERE_' https://github.com/api/v2/json/repos/delete/_REPO_NAME_
(The API_TOKEN_HERE can be found in Account Settings, under Administrative Information.)
If the curl command succeeds, it will return something similar to {"delete_token":"abcdefgh"}
. Use this token in the following:
$ curl -F 'login=ootput' -F 'token=_API_TOKEN_HERE_' -F 'delete_token=abcdefgh' https://github.com/api/v2/json/repos/delete/_REPO_NAME_
If all goes well, curl will return {"status":"deleted"}
You can use the -k
(or --insecure
) option for curl to bypass certificate verification.