Skip to main content
Glama
test-v2-response.cjs1.59 kB
const axios = require('axios'); async function testV2Response() { 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; console.log('✅ Authenticated'); console.log(`User Key: ${userKey}\n`); const apiKey = `${userKey}:${ACCOUNT_KEY}:${DIVISION_ID}`; console.log('Testing v2 API response structure...\n'); const response = await axios.get(`${BASE_URL}/v2/invoices/cost-and-usage`, { params: { startDate: '2025-09-01', endDate: '2025-10-07', isNetAmortized: true, costType: ['cost', 'discount'], periodGranLevel: 'month', groupBy: 'none' }, headers: { 'Authorization': token, 'apikey': apiKey } }); console.log('Response structure:'); console.log(JSON.stringify(response.data, null, 2)); } 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)); } } } testV2Response();

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