Skip to content

Instantly share code, notes, and snippets.

@rocksinghajay
Last active December 13, 2018 18:37
Show Gist options
  • Select an option

  • Save rocksinghajay/fe0b67045643d2b27beb3fb376131759 to your computer and use it in GitHub Desktop.

Select an option

Save rocksinghajay/fe0b67045643d2b27beb3fb376131759 to your computer and use it in GitHub Desktop.
axios.post('https://api.sandbox.paypal.com/v1/oauth2/token', { grant_type: 'client_credentials' },
{
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': ` ` // your Authorization value you get from postman api hit
}
}
)
.then(response => {
console.log(response.data.access_token)
}).catch(err => {
console.log({ ...err })
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment