'POSTMAN Error 422 - Unprocessable Entity, with GitHub API. What is it and how do solve it?

What is the meaning of this error code and how do I fix it? I am trying to access the statuses of a repository found in my GitHub profile using Postman.

The link of my repo statuses was taken from the GitHub API and posted in Postman next to the POST address bar as seen on the screenshot below. Once I hit "Send", the resulting status was a 422 Unprocessable Entity

enter image description here enter image description here

Anyone familiar with Postman and GitHub, and GitHub API knows what does this mean and any ideas on how to bypass this error and get at least a success code instead.



Solution 1:[1]

I was having this problem, and the root cause was that I was sending an outdated pull request event payload to the API. I had copied the webhook payload from the GitHub -> Hooks UI, which contained the PR number and the head commit SHA at that time. Then I made a new commit into the head branch of the PR, meaning that the head commit SHA of the PR was different than it was when I originally copied the event. Updating the SHA in the payload resolved the issue for me.

Solution 2:[2]

Changing the Content-type from text/plain to application/json in the header fixed it for me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Spencer Goff
Solution 2