Skip to main content
Glama
debug-find-accountid.cjsβ€’3.63 kB
#!/usr/bin/env node /** * Debug findCustomerByAccountId functionality */ const axios = require('axios'); async function debugFindAccountId() { console.log('πŸ” DEBUG FIND ACCOUNT ID\n'); console.log('========================\n'); try { // Authenticate const authResponse = await axios.post('https://api.umbrellacost.io/api/v1/users/signin', { username: 'david+allcloud@umbrellacost.com', password: 'B4*zcI7#F7poEC' }); const token = authResponse.data.jwtToken; const userKey = JSON.parse(Buffer.from(token.split('.')[1], 'base64').toString()).sub; // Get divisions const tempApiKey = `${userKey}:15808:0`; const divisionsResponse = await axios.get('https://api.umbrellacost.io/api/v1/users/plain-sub-users', { headers: { 'Authorization': token, 'apikey': tempApiKey } }); const customerDivisions = divisionsResponse.data.customerDivisions; console.log('Looking for accountId 696314371547 (Bank Leumi Reseller-1):\n'); // Search for the account ID let found = false; for (const [customerName, divisions] of Object.entries(customerDivisions)) { if (Array.isArray(divisions)) { for (const division of divisions) { if (division.accountId === '696314371547' || division.accountId === 696314371547) { console.log(`βœ… FOUND in customer "${customerName}"`); console.log(` Division: ${division.accountName}`); console.log(` Account Key: ${division.accountKey}`); console.log(` Division ID: ${division.divisionId}`); console.log(` Account ID: ${division.accountId} (type: ${typeof division.accountId})\n`); found = true; break; } } } if (found) break; } if (!found) { console.log('❌ NOT FOUND\n'); // Check what Bank Leumi has console.log('Bank Leumi divisions:\n'); const leumiDivisions = customerDivisions['Bank Leumi']; if (leumiDivisions) { leumiDivisions.forEach(div => { console.log(` ${div.accountName}:`); console.log(` accountId: ${div.accountId} (type: ${typeof div.accountId})`); console.log(` accountKey: ${div.accountKey}`); console.log(` divisionId: ${div.divisionId}\n`); }); } } console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'); console.log('Looking for accountId 533084403826 (Bank Leumi BL Test Env):\n'); // Search for the second account ID found = false; for (const [customerName, divisions] of Object.entries(customerDivisions)) { if (Array.isArray(divisions)) { for (const division of divisions) { if (division.accountId === '533084403826' || division.accountId === 533084403826) { console.log(`βœ… FOUND in customer "${customerName}"`); console.log(` Division: ${division.accountName}`); console.log(` Account Key: ${division.accountKey}`); console.log(` Division ID: ${division.divisionId}`); console.log(` Account ID: ${division.accountId} (type: ${typeof division.accountId})\n`); found = true; break; } } } if (found) break; } if (!found) { console.log('❌ NOT FOUND\n'); } } catch (error) { console.error('❌ Error:', error.response?.data || error.message); } } debugFindAccountId().catch(console.error);

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