When I execute the following code I get the following error message: grant type in request is not supported by the authorization server
What I am doing wrong?
const axios = require("axios"); | |
axios.request({ | |
url: "/identity/v1/oauth2/token", | |
method: "POST", | |
baseURL: "https://api.sandbox.ebay.com/", | |
auth: { | |
username: "", // eBay client id | |
password: "" // eBay client secret | |
}, | |
headers: { 'content-type': 'application/x-www-form-urlencoded' }, | |
data: { | |
"grant_type": "client_credentials", | |
"scope": "https://api.ebay.com/oauth/api_scope" | |
} | |
}).then(res => { | |
console.log(res); | |
}).catch(error => { | |
console.log(error) | |
}) |
Top comments (1)
If I remember correctly content type is Content-Type: application/json
and not x-www-form-urlencoded.