Generate access token / token key for Pinterest?

Any code example for https://api.pinterest.com/v3/oauth/access_token API.

Followed this document but while implementing it, I am getting following error in response.

{
    "error": {
        "message": "None",
        "oauth_error_code": "invalid_grant"
    },
    "code": 283,
    "data": null,
    "message": "The authorization grant is invalid",
    "endpoint_name": "oauth_access_token",
    "status": "failure"
}