Bandwidth / node-numbers

Node SDK for Bandwidth Numbers
https://dev.bandwidth.com
MIT License
1 stars 5 forks source link

Notification sets for new Order and disconnect Order but didn't get proper response as per document. #67

Open klals opened 10 months ago

klals commented 10 months ago

Description

I have set a notification for new order and disconnect order, After Order create, my webhook url call but in console or log file not get order_id, order_type , order status etc. details. I want to get order detail(i.e. orderId, orderStatus etc.) when new number order and Disconnect Number. Also i have add code snippet for webhook url callback function.

Sample Code Snippet

Here, is my api function which i try to read order details export const getBandwidthOrderNewWebhook = async (req, res) => { try { const logMessage = ${new Date().toISOString()} - Request: ${req.res}\n;

    // Log the request to the file
    fs.appendFileSync('public/api_log.log', logMessage);

    console.log(req.res);
    res.status(200).json({ msg: true });

} catch (error) {
    console.error(error);
    res.status(500).json({ msg: 'Internal Server Error' });
}

};