Code Snippets-api-request-axios

API Request with axios

You can easy integrate API requests into your automation workflows with CustomJS and Axios. In this example, we'll show you how to make a POST request to an API. By using CustomJS in Make.com, we have optimized the process with dynamic parameters that appear automatically when you use the “Execute a stored function” module. This ensures a smooth and efficient integration that allows you to automate complex HTTP requests without much effort. Perfect for developers and no-code users who want to extend their Make.com automations with custom API calls.
Axios Request With Make.com
Axios Request With Make.com
const axios = require('axios');

async function sendPostRequest() {
  const payload = {
    username: input.username, 
    password: input.password  
  };

  try {
    const response = await axios.post('https://eokqlfv344gxnv0o.m.pipedream.net', payload);
    console.log('Response:', response.data);
    return response.data;
  } catch (error) {
    console.error('Error:', error);
    return { error: error.message };
  }
}

return sendPostRequest();
Axios Request With Make.com
Axios Request With Make.com