json - GitHub API AJAX POST returning 422 -
i'm trying post issue via github api , keep getting 422 error. i've tried various approaches on past few days no luck - i'm hoping simple mistake can spot quickly?
my call below - i'm using personal access token authorization.
$.ajax({ type: "post", url: `https://api.github.com/repos/myusername/myreponame/issues?access_token=myaccesstoken`, contenttype: "application/json", datatype: "json", data: json.stringify({ "title": "found bug", "body": "i'm having problem this." }) }).done(function( data ) { console.log( data ); });
thanks in advance.
fyi got work code below post github api (creating issue):
$.ajax({ url: 'https://api.github.com/repos/username/reponame/issues', type: 'post', datatype: 'json', headers: { authorization: 'token my_personal_token' }, data: json.stringify({ "title": "found bug", "description": "bug description" }), success: function (response) { console.log(response); } });
Comments
Post a Comment