admin管理员组

文章数量:1128673

I'm working with the Nextcloud API and I've encountered an issue where joining a room is currently only possible if I have cookies, as it requires an active session. All my other API's are working fine.

const createApiClient = (baseURL, username, password) => {if (!baseURL || !username || !password) {
throw new Error("Base URL, username, and password are required to create an API client.");}const token = Buffer.from(`${username}:${password}`).toString("base64");return axios.create({
baseURL,
headers: {
  Authorization: `Basic ${token}`,
  "Content-Type": "application/json",
  "OCS-APIRequest": "true",
},
withCredentials: true});};



router.post("/room/:roomID/call", check_parms, adminMiddleware, validateFieldsMiddleware(["roomID"]), async (req, res, next) => {
try {
    let { roomID } = res.locals.json_req || {};
    
    const response = await req.apiClient.post(`/ocs/v2.php/apps/spreed/api/v4/call/${roomID}`, {
        flags: 3,
        silent: false,
        recordingConsent: false
    });
    console.log(response)
    
    res.status(200).json(successResponse("User deleted successfully.", response.data.ocs.data));
   
} catch (error) {
    return next(error);
}});

Its return 404

本文标签: