Skip to main content
Glama
test-unblended-variations.cjs2.77 kB
const axios = require('axios'); async function testUnblendedVariations() { const BASE_URL = 'https://api.dev.umbrellacost.dev/api'; const USERNAME = 'elisha+testmcpdev@anodot.com'; const PASSWORD = 'Test123!'; const ACCOUNT_KEY = '111111639'; const DIVISION_ID = '0'; try { console.log('🔐 Authenticating...\n'); const authResponse = await axios.post(`${BASE_URL}/v1/users/signin`, { username: USERNAME, password: PASSWORD }); const token = authResponse.data.jwtToken; const tokenPayload = JSON.parse(Buffer.from(token.split('.')[1], 'base64').toString()); const userKey = tokenPayload.sub; const apiKey = `${userKey}:${ACCOUNT_KEY}:${DIVISION_ID}`; console.log('✅ Authenticated\n'); const tests = [ { name: 'Unblended with [cost, discount]', params: { startDate: '2025-01-01', endDate: '2025-10-08', isUnblended: true, costType: ['cost', 'discount'], periodGranLevel: 'month', groupBy: 'none' } }, { name: 'Unblended with [cost] only', params: { startDate: '2025-01-01', endDate: '2025-10-08', isUnblended: true, costType: ['cost'], periodGranLevel: 'month', groupBy: 'none' } }, { name: 'Unblended without costType', params: { startDate: '2025-01-01', endDate: '2025-10-08', isUnblended: true, periodGranLevel: 'month', groupBy: 'none' } }, { name: 'No flags (API default)', params: { startDate: '2025-01-01', endDate: '2025-10-08', periodGranLevel: 'month', groupBy: 'none' } } ]; for (const test of tests) { console.log('═'.repeat(80)); console.log(test.name); console.log('═'.repeat(80)); const response = await axios.get(`${BASE_URL}/v2/invoices/cost-and-usage`, { params: test.params, headers: { 'Authorization': token, 'apikey': apiKey } }); if (response.data.data && response.data.data.length > 0) { const janCost = response.data.data[0].total_cost; console.log(`Jan 2025: $${janCost.toFixed(2)}`); if (Math.abs(janCost - 120021.98) < 1) { console.log('⚠️ This is the 120K value!'); } } console.log(''); } } catch (error) { console.error('❌ Error:', error.message); if (error.response) { console.error('Status:', error.response.status); console.error('Data:', JSON.stringify(error.response.data, null, 2)); } } } testUnblendedVariations();

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/daviddraiumbrella/invoice-monitoring'

If you have feedback or need assistance with the MCP directory API, please join our Discord server