Documentation for the requested version is not available.Documentation for the requested diff is not available.
InfoService
The Info Service allows you to obtain some basic information about your API
usage. For example, it lets you find out how many operations you have
performed during a given date range in total or for a specific method. You
can also get basic data, such as how many API units your token entitles you
to this month, the cost of a specific method, and how many API units have
been used by calls to a specific method.
// Get quota usage.
long totalLimit = service.getUsageQuotaThisMonth();
long freeQuotaLimit = service.getFreeUsageQuotaThisMonth();
long totalUsed = service.getUnitCount(
new GregorianCalendar(2009, 0, 1).getTime(),
new GregorianCalendar(2009, 0, 31).getTime());
// Get quota usage.
long totalLimit = service.getUsageQuotaThisMonth();
long freeQuotaLimit = service.getFreeUsageQuotaThisMonth();
long totalUsed = service.getUnitCount(
new DateTime(2009, 1, 1),
new DateTime(2009, 1, 31));
Retrieves the cost, in API units per operation, of the given method on a
specific date for the developer token being used to make this call.
Methods default to a cost of 1.
Parameters
Parameter name
Parameter type
Parameter description
service
string
The name of the service containing the method, for example,
"ReportService".
method
string
The method whose cost is being queried, for example
"scheduleReportJob".
date
date
The date for which to retrieve the cost of the method. An
error occurs if this date is in the future.
Response
Response type
Response description
int
the cost, in API units per operation
getOperationCount
Retrieves the number of operations recorded for the developer token being
used to make this call over the given date range. The time zone is
implicitly assumed to be Pacific time (PST or PDT). The given dates are
inclusive; to get the operation count for a single day, supply it as both
the start and end date.
Parameters
Parameter name
Parameter type
Parameter description
startDate
date
the beginning of the date range, inclusive
endDate
date
the end of the date range, inclusive
Response
Response type
Response description
long
the number of operations recorded for the developer token being
used to make this call over the given date range
Retrieves this month's usage quota for the developer token being used to
make this call.
Response
Response type
Response description
long
this month's usage quota, in units, for the developer token being
used to make this call
getUnitCount
Retrieves the number of API units recorded for the developer token being
used to make this call over the given date range. The time zone is
implicitly assumed to be Pacific time (PST or PDT). The given dates are
inclusive; to get the unit count for a single day, supply it as both the
start and end date.
An error occurs if the startDate falls after the endDate or if either
date is in the future.
Parameters
Parameter name
Parameter type
Parameter description
startDate
date
the beginning of the date range, inclusive
endDate
date
the end of the date range, inclusive
Response
Response type
Response description
long
the number of API units recorded for the developer token being used
to make this call over the given date range
// Get quota usage.
long totalLimit = service.getUsageQuotaThisMonth();
long freeQuotaLimit = service.getFreeUsageQuotaThisMonth();
long totalUsed = service.getUnitCount(
new GregorianCalendar(2009, 0, 1).getTime(),
new GregorianCalendar(2009, 0, 31).getTime());
// Get quota usage.
long totalLimit = service.getUsageQuotaThisMonth();
long freeQuotaLimit = service.getFreeUsageQuotaThisMonth();
long totalUsed = service.getUnitCount(
new DateTime(2009, 1, 1),
new DateTime(2009, 1, 31));
Retrieves the number of API units recorded for a subset of clients over the
given date range for the developer token being used to make this call. The
time zone is implicitly assumed to be Pacific time (PST or PDT). The given
dates are inclusive; to get the unit count for a single day, supply it as
both the start and end date.
An error occurs if the startDate falls after the endDate or if either
date is in the future.
Parameters
Parameter name
Parameter type
Parameter description
clientEmails
string[]
List of login email used to identify the clients to
retrieve API units for. If the array is null or empty,
this call will list the API units for all clients.
a list of ClientUsageRecords, could be empty if there was no usage
for the given clients and date range.
getUnitCountForMethod
Retrieves the number of API units recorded for the developer token being
used to make this call over the given date range for a specific method.
The time zone is implicitly assumed to be Pacific time (PST or PDT). The
given dates are inclusive; to get the unit count for a single day, supply
it as both the start and end date.
An error occurs if the startDate falls after the endDate or if either
date is in the future.
Parameters
Parameter name
Parameter type
Parameter description
service
string
The name of the service containing the method, for
example, "ReportService".
method
string
The method whose API unit usage is being queried, for
example "scheduleReportJob".
startDate
date
The beginning of the date range, inclusive.
endDate
date
The end of the date range, inclusive.
Response
Response type
Response description
long
the number of API units that have been used up by the specific
method over the given date range.
getUsageQuotaThisMonth
Retrieves the total number of API units for this entire month that can be
used by the developer token being used to make this call. Includes both
free and paid API units.
Response
Response type
Response description
long
the total number of API units, including free units, for this
entire month, for the developer token being used to make this
call.
// Get quota usage.
long totalLimit = service.getUsageQuotaThisMonth();
long freeQuotaLimit = service.getFreeUsageQuotaThisMonth();
long totalUsed = service.getUnitCount(
new GregorianCalendar(2009, 0, 1).getTime(),
new GregorianCalendar(2009, 0, 31).getTime());
// Get quota usage.
long totalLimit = service.getUsageQuotaThisMonth();
long freeQuotaLimit = service.getFreeUsageQuotaThisMonth();
long totalUsed = service.getUnitCount(
new DateTime(2009, 1, 1),
new DateTime(2009, 1, 31));
<!-- Retrieves the total number of API units for this entire month that -->
<!-- can be used by the developer token being used to make this call. -->
<getUsageQuotaThisMonth/>