Provides daily cumulative per-source API call counts for a usage period.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.apiCalls.getDailyPerSourceAPICallsUsage('2021-02-01')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "dailyPerSourceAPICallsUsage": [
- {
- "sourceId": "rh5BDZp6QDHvXFCkibm1pR",
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "sourceId": "rh5BDZp6QDHvXFCkibm1pR",
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "sourceId": "rh5BDZp6QDHvXFCkibm1pR",
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "sourceId": "rh5BDZp6QDHvXFCkibm1pR",
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "sourceId": "rh5BDZp6QDHvXFCkibm1pR",
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "sourceId": "rh5BDZp6QDHvXFCkibm1pR",
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "sourceId": "rh5BDZp6QDHvXFCkibm1pR",
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "sourceId": "rh5BDZp6QDHvXFCkibm1pR",
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "sourceId": "rh5BDZp6QDHvXFCkibm1pR",
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "sourceId": "rh5BDZp6QDHvXFCkibm1pR",
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}
], - "pagination": {
- "current": "MA==",
- "next": "MTA=",
- "totalEntries": 28
}
}
}
Provides daily cumulative API call counts for a usage period.
OK
Resource not found
Validation failure
Too many requests
import { configureApis, unwrap } from '@segment/public-api-sdk-typescript' const api = configureApis('/* Insert your Public API token here */') try { const result = await unwrap(api.apiCalls.getDailyWorkspaceAPICallsUsage('2021-02-01')) console.log(JSON.stringify(result)) } catch (e) { console.log('ERROR:', e) }
{- "data": {
- "dailyWorkspaceAPICallsUsage": [
- {
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}, - {
- "apiCalls": "0",
- "timestamp": "2006-01-02T15:04:05.000Z"
}
], - "pagination": {
- "current": "MA==",
- "next": "MTA=",
- "totalEntries": 28
}
}
}