Documentation Index
Fetch the complete documentation index at: https://domoinc-arun-raj-connectors-domo-479695-remove-crime-report.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Creating a Custom Package
- Click + New Package (ensure you have the required grants).
- Fill in the required fields:
- Package Name
- Package Description
- Language (JavaScript or Python)
- (Optional) Upload a thumbnail.
- Click Create New Package to open it in the code editor.
Creating a New Package Version
To update a package (e.g., add or update a function):
- Open the package in the code editor.
- Click Create New Version.
- Select a version to copy from.
- Enter the new version number (Semantic Versioning).
- (Optional) Add a version description.
- Click Create New Version.
The new version becomes the default, but you can access earlier versions as needed.
Code Engine Library
The Code Engine library provides methods for internal and external API calls. Import it with require("codeengine").
codeengine.sendRequest
Make calls to internal Domo APIs. Example:
const codeengine = require('codeengine');
function getDataSetMetadata(dataSetId) {
const url = `api/data/v3/datasources/${dataSetId}?part=core,permission,status,pdp,rowcolcount,certification,functions`;
return codeengine.sendRequest('get', url).catch(console.error);
}
codeengine.getAccount
Retrieve account credentials for use in external API calls. Example:
const codeengine = require('codeengine');
async function accountExample(twilioAccount) {
const account = await codeengine.getAccount(twilioAccount.id);
const { accountSID, password } = account.properties;
}
codeengine.axios
Make external HTTP requests. Example:
const codeengine = require('codeengine');
async function sendTwilioSms(to, from, body) {
const account = await codeengine
.getAccount('Twilio')
.then((a) => a.properties);
const url = `https://api.twilio.com/2010-04-01/Accounts/${account.SID}/Messages.json`;
const data = new URLSearchParams();
data.append('To', to);
data.append('From', from);
data.append('Body', body);
const requestOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
Authorization:
'Basic ' +
Buffer.from(`${account.SID}:${account.TOKEN}`).toString('base64'),
},
data,
};
try {
const response = await codeengine.axios(url, requestOptions);
const jsonResponse = await response.data;
if (response.ok) {
console.log('SMS sent successfully:', jsonResponse);
return jsonResponse;
} else {
console.error('Error sending SMS:', jsonResponse);
throw new Error(jsonResponse.message);
}
} catch (error) {
console.error('Error:', error);
throw error;
}
}