'how to send authorization throught get request axios . pinterest api v5
i tried to read the pins from pinterest api but i don't know how to authorize using the app id and the secret app id. i tried to read the docs but i didn't understand the way to make authorization and get the pins list
const axios = require("axios");
const username = "";
const password = "";
const token = Buffer.from(`${username}:${password}`, "utf8").toString("base64");
const url =
"https://api.pinterest.com/v5/pins/14425661293229561&client_id=1477150&scope=boards:read,pins:read";
axios.post(url, {
headers: {
Authorization: `Basic ${token}`,
},
});
axios
.get(url, {
headers: {
Authorization: `Basic ${token}`,
},
})
.then((res) => {
console.log(res.code);
})
.catch((e) => console.log("hello"));
Here is an example request to the OAuth page:
https://www.pinterest.com/oauth/?
client_id={YOUR_CLIENT_ID}&
redirect_uri={YOUR_REDIRECT_URI}&
response_type=code&
scope=boards:read,pins:read&
state={YOUR_OPTIONAL_STRING}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
