Error: "subject" must be a string
H
I want to upload file and create folder using node.js backend REST APIs. To achieve my objective I used bellow link & used JWT .
https://developer.box.com/guides/applications/custom-apps/jwt-setup/
I downloaded confifg.json and used it to create client.
Objective : Create a folder
Code:
var BoxSDK = require("box-node-sdk");
var config = require("../config/box.json");
router.get("/create_folder", function (req, res, next) {
try {
var sdk = BoxSDK.getPreconfiguredInstance(config);
var client = sdk.getAppAuthClient("user");
client.folders
.create("0", "Logfolder")
.then((folder) => {
console.log("->", folder);
res.json({ folder: folder });
})
.catch((error) => {
console.log("error-->", error);
});
} catch (err) {
console.log("error===>", err);
}
});
Error :
Error: "subject" must be a string
Error Line:
client.folders
.create("0", "Logfolder")
Please help me
サインインしてコメントを残してください。
コメント
0件のコメント