Access the Workday SOAP API with custom integrations
Create an integration
Authorize Workday
Call the Workday SOAP API
npm i @nangohq/node soap
. Then run:import { Nango } from '@nangohq/node';
import soap from 'soap';
const nango = new Nango({ secretKey: '<NANGO-SECRET-KEY>' });
const connectionId = '<CONNECTION-ID>';
const providerConfigKey = '<INTEGRATION-ID>';
const connection = await nango.getConnection(providerConfigKey, connectionId);
const { credentials, connection_config } = connection;
if (
credentials.type !== "BASIC" ||
!credentials.username ||
!credentials.password ||
!connection_config["hostname"] ||
!connection_config["tenant"]
) {
throw new Error(
"Invalid credentials: BASIC auth, username, password, hostname, and tenant are all required."
);
}
// Example: Get workers using Human_Resources service
const serviceType = 'Human_Resources';
const version = '40.0';
const wsdlUrl = `https://community.workday.com/sites/default/files/file-hosting/productionapi/${serviceType}/v${version}/${serviceType}.wsdl`;
const endpointUrl = `https://${connection_config["hostname"]}/ccx/service/${connection_config["tenant"]}/${serviceType}/v${version}`;
const client = await soap.createClientAsync(wsdlUrl, {});
client.addHttpHeader("Accept-Encoding", "gzip, deflate"); // Needed or some queries will fail https://github.com/axios/axios/issues/4806
client.setSecurity(
new soap.WSSecurity(credentials.username, credentials.password),
);
client.setEndpoint(endpointUrl);
// Make SOAP request to Get_WorkersAsync
const [res] = await client["Get_WorkersAsync"]({
Response_Filter: {
Page: 1,
Count: 100,
},
});
console.log('Workers Response:', JSON.stringify(res, null, 2));
Was this page helpful?