Message 1 of 1
Problem with GET /api/library/folders
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello. I have used library API (api/library/folders) to get the folders of a project. But whatever project_id I used, it returned always the same folders of one of my projects.
my code like this:
var express = require("express");
var router = express.Router();
var axios = require("axios");
const b360api = require("../public/javascripts/BIM360API");
const URLS = require("../public/javascripts/b360Urls");
router.post("/", (req, response) => {
console.log("project_id in request: ", req.body);
//#region
// const folderUrl = b360api.transGetUrl(URLS.baseUrl + URLS.folders, {
// project_id: "123",
// ticket: b360api.TICKET,
// });
//#endregion
const testUrl =
URLS.baseUrl +
URLS.folders +
`?project_id=${req.body.project_id}&ticket=${b360api.TICKET}`;
console.log("full Url: ", testUrl);
axios
.get(testUrl)
.then((res) => {
const data = res.data;
console.log("id of firstFolder: ",data[0].id);
response.send(data);
})
.catch((err) => {
response.send(err.message);
});
});
module.exports = router;
I have made several requests like . I have changed the project_id and even changed project_id to 123 or null, and got the same result.
Result