How to use the requests proxy from Nango
try { const res = await nango.proxy({ method: 'POST', baseUrlOverride: 'https://api.example.com', endpoint: '/external-endpoint', providerConfigKey: '<string>', connectionId: '<string>', retries: 5, // Retries with exponential backoff (optional, default 0) data: { id: 1, colorId: 'blue', selected: true } }); // Response was 200! // See https://axios-http.com/docs/res_schema console.log(res.data); } catch (error) { // Status of response != 200 // See https://axios-http.com/docs/handling_errors console.log(error.response.data); console.log(error.response.status); console.log(error.response.headers); }
curl -X POST -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <NANGO-SECRET-KEY>' \ -H 'Provider-Config-Key: <INTEGRATION-ID>' \ -H 'Connection-Id: <CONNECTION-ID>' \ -d '{"colorId: "blue"}' \ 'https://api.nango.dev/proxy/<API-ENDPOINT>'
Was this page helpful?