Skip to main content

Hi all,

Im trying to build a new item view, i want the view look like a form in order to fill hours reports, something like this:


i want to send an api request to my other software in order to get all my orders.

when i send the request i get this error: AxiosError: Network Error


how can i send api request to another software?


this is my code (the relevant part):


import “./App.css”;

import mondaySdk from “monday-sdk-js”;

import “monday-ui-react-core/dist/main.css”;

import AttentionBox from “monday-ui-react-core/dist/AttentionBox.js”;

import axios from “axios”; // Import Axios for making HTTP requests


const monday = mondaySdk();

monday.setApiVersion(“2023-10”);


const App = () => {

const =context, setContext] = useState();

const tproject, setProject] = useState(“”);

const torder, setOrder] = useState(“”);


useEffect(() => {

// Function to fetch data from the API

const fetchData = async () => {

try {

const response = await axios.get(

https://www.eshbelsaas.com/xxxx/xxxxxx/xxxxx?$select=ORDNAME&$filter=DOCNO%20eq%20’PR21000008’”,

{

headers: {

Authorization: “Basic xxxxxxxxxxxxxx”

}

}

);

console.log(“API Response:”, response.data);

monday.execute(“notice”, {

message: response.data:${response.data},

type: “info”,

timeout: 10000

});

} catch (error) {

monday.execute(“notice”, {

message: error:${error},

type: “info”,

timeout: 10000

});

console.error(“Error fetching data:”, error);

}

};


// Call the fetchData function when the component mounts
fetchData();

// Other useEffect code remains the same
monday.execute("valueCreatedForUser");
monday.api(`query { users { id, name } }`).then((resss) => {
/* monday.execute("notice", {
message: `${resss.data.users/5].name}`,
type: "info",
timeout: 10000
});*/
});

monday.listen("context", (res) => {
setContext(res.data);
console.log("Context:", res.data);
});

}, );

Hello there @shay.butran,


Would you be able to please fill this form so our team can take a look into this? Please add as much detail about your case as possible.


Looking forward to hearing from you via the form!


Cheers,

Matias


Reply