RE: I am trying to use Restlet api using oauth 1.0 and i am getting this issue
what contents you are looking for ? Is that the whole function?
below i writing down the whole function please check this,if you found any error please let me know-
const SyncNewOrdersWithRestlet = async function (req, res) {
constRestletConfig = awaitgetConfig();
letdata_array = {…}
console.log(RestletConfig.NONCE, “with encoding”, encodeURIComponent(RestletConfig.SIGNATURE))
console.log(“Timestamp”, RestletConfig.TIMESTAMP)
letconfig = {
method:”POST”,
url:”https://****001-sb1.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=569&deploy=1″,
headers: {
Authorization:`OAuth oauth_consumer_key=”${RestletConfig.CONSUMER_KEY}”,oauth_nonce=”${RestletConfig.NONCE}”,oauth_signature_method=”HMAC-SHA256″,oauth_token=”${RestletConfig.TOKEN_ID}”,oauth_timestamp=”${RestletConfig.TIMESTAMP}”,oauth_version=”1.0″,oauth_signature=”${encodeURIComponent(RestletConfig.SIGNATURE)}”`,
“Content-Type”:”application/json”,
“Connection” :”keep-alive”
},
// realm=”${RestletConfig.ACCOUNT_ID}”
data:JSON.stringify(data_array),
};
// return false
axios(config).then(async () => {
// console.log(“————–“,response);
console.log(“ORDER SYNC SUCCESS”);
}).catch(({ response }) => {
// console.log(“FAILED”);
console.log(“here response started”,response);
});
};
module.exports.SyncNewOrdersWithRestlet = SyncNewOrdersWithRestlet;