Skip to content

Instantly share code, notes, and snippets.

@sm-a
Last active May 26, 2019 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sm-a/32f48e7b9170902dec5c3156c8a533d4 to your computer and use it in GitHub Desktop.
Save sm-a/32f48e7b9170902dec5c3156c8a533d4 to your computer and use it in GitHub Desktop.
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)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment