Create a new “Delete issue (GraphQL)” request.Let’s try to use this deleteIssue mutation: You can read my And GraphQL for all post to learn more about GraphQL. In GraphQL, a request can contains many queries (to read data) and mutations (to modify data), actually mutations can be seen as functions. I will not go into details about GraphQL.įor what we need to do today, you only need to know that to send requests to a GraphQL API you always use a POST request and tell what you want to do in the body using GraphQL query language. Hopefully there are 2 Github APIs: the REST one and the GraphQL one.Īnd you can delete issues with Github GraphQL API using the deleteIssue mutation.Īnd even more hopefully, you can use the same token to access both APIs. Seriously, don’t do that at home, use HTTP protocol correctly, never, ever return a 404 Not Found when a method is not available, return a 405 Method Not Allowed instead. Let’s check what the documentation says (link provided in documentation_url), look for Issues in the left navigation bar.Īctually, you can’t delete an issue with Github REST API! Obviously not, because a GET on it actually returned something. That returns a 404 Not Found, does that mean this issue doesn’t exist?! Now change method to DELETE and hit send again ….Hit the Send button to check what happens when doing a GET on that URL.Let’s try to delete the first issue in the list: No need to actually think about it because the ready to use url is actually provided!Īnd by the way it tells us that the id to use is number (with user and repo name). Having an access token, we’ll configure our collection in order to make all requests that it will contain use it.īut we will do that in a secure way using an environment variable, it’s a best practice that allows to share collections without the risk of sharing sensitive data:Ī github issue seems to have 3 “ids”: id, node_id and number, which one to choose?
Note that this scopes obviously gives access to public repositories only, if you want to access private ones, you’ll have to check the repo scope (which is less obvious).Ĭopy the generated token by clicking on (use this token with caution, never, ever, commit this value in any public source code repository!)Ĭonfiguring Authorization in Postman and make a successful first API call In the “Note” field, type “postman-csv-demo”Ĭheck the public_repo scope under repo.
In developer setting page, click on Personal access tokensĬlick on Generate new token (you may have to provide your password) Scroll down and click on Developer setting in the left menu
Go to your Github account settings by clicking on your profile icon and clicking on “Settings” (at the bottom)