My favorites | English | Sign in

Documentation for the requested version is not available.Documentation for the requested diff is not available.

InfoService

Link to this version

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.

More Information

Requests

getFreeUsageQuotaThisMonth

Retrieves the number of free API units for this entire month that can be used by the developer token being used to make this call.

Response

long the number of free API units for this entire month, for the developer token being used to make this call

Samples

Code sample not available.
58
59
60
61
62
63
      // 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());

Code sample not available.
55
56
57
58
59
60
        // 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));

Code sample not available.
62
63
64
65
66
67
68
69
70
71
72
# Get quota usage.
my $total_limit = $service->call('getUsageQuotaThisMonth' => @headers)
  ->result();
my $free_quota_limit = $service->call('getFreeUsageQuotaThisMonth' =>
  @headers)->result();
my $start_date = SOAP::Data->name('startDate' =>
  POSIX::strftime('%Y-%m-01T00:00:00', localtime()));
my $end_date = SOAP::Data->name('endDate' =>
  POSIX::strftime('%Y-%m-%dT00:00:00', localtime()));
my $total_used = $service->call('getUnitCount' => $start_date, $end_date,
  @headers)->result();

Code sample not available.
49
50
51
52
53
54
55
# Get quota usage.
total_limit = info_service.getUsageQuotaThisMonth()
free_quota_limit = info_service.getFreeUsageQuotaThisMonth()
start_date = datetime.datetime.now().strftime('%Y-%m-01T00:00:00')
end_date = datetime.datetime.now().strftime('%Y-%m-%dT00:00:00')
total_used = info_service.getUnitCount(SOAPpy.Types.untypedType(start_date),
                                       SOAPpy.Types.untypedType(end_date))

Code sample not available.
64
65
66
67
68
69
70
71
72
# Get quota usage.
total_limit = info_service.getUsageQuotaThisMonth(nil
  ).getUsageQuotaThisMonthReturn
free_quota_limit = info_service.getFreeUsageQuotaThisMonth(nil
  ).getFreeUsageQuotaThisMonthReturn
start_date = DateTime.now.strftime('%Y-%m-01')
end_date = DateTime.now.strftime('%Y-%m-%d')
total_used = info_service.getUnitCount(:startDate => start_date,
  :endDate => end_date).getUnitCountReturn

Code sample not available.
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Get quota usage.
$request_xml = '<getUsageQuotaThisMonth></getUsageQuotaThisMonth>';
$total_limit = $info_service->call('getUsageQuotaThisMonth', $request_xml);
$total_limit = $total_limit['getUsageQuotaThisMonthReturn'];
if ($debug) show_xml($info_service);
if ($info_service->fault) show_fault($info_service);

$request_xml = '<getFreeUsageQuotaThisMonth></getFreeUsageQuotaThisMonth>';
$free_quota_limit = $info_service->call('getFreeUsageQuotaThisMonth');
$free_quota_limit = $free_quota_limit['getFreeUsageQuotaThisMonthReturn'];
if ($debug) show_xml($info_service);
if ($info_service->fault) show_fault($info_service);

$request_xml =
  '<getUnitCount>' .
  '<startDate>2008-01-01</startDate><endDate>2008-01-31</endDate>' .
  '</getUnitCount>';
$total_used = $info_service->call('getUnitCount', $request_xml);
$total_used = $total_used['getUnitCountReturn'];

Code sample not available.
Select a programming language to view its sample

getMethodCost

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

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

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

startDate date
the beginning of the date range, inclusive
endDate date
the end of the date range, inclusive

Response

long the number of operations recorded for the developer token being used to make this call over the given date range

getOperationsQuotaThisMonth

Deprecated. Will be removed in a future version. Please use getUsageQuotaThisMonth instead.

Retrieves this month's usage quota for the developer token being used to make this call.

Response

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

startDate date
the beginning of the date range, inclusive
endDate date
the end of the date range, inclusive

Response

long the number of API units recorded for the developer token being used to make this call over the given date range

Samples

Code sample not available.
58
59
60
61
62
63
      // 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());

Code sample not available.
55
56
57
58
59
60
        // 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));

Code sample not available.
62
63
64
65
66
67
68
69
70
71
72
# Get quota usage.
my $total_limit = $service->call('getUsageQuotaThisMonth' => @headers)
  ->result();
my $free_quota_limit = $service->call('getFreeUsageQuotaThisMonth' =>
  @headers)->result();
my $start_date = SOAP::Data->name('startDate' =>
  POSIX::strftime('%Y-%m-01T00:00:00', localtime()));
my $end_date = SOAP::Data->name('endDate' =>
  POSIX::strftime('%Y-%m-%dT00:00:00', localtime()));
my $total_used = $service->call('getUnitCount' => $start_date, $end_date,
  @headers)->result();

Code sample not available.
49
50
51
52
53
54
55
# Get quota usage.
total_limit = info_service.getUsageQuotaThisMonth()
free_quota_limit = info_service.getFreeUsageQuotaThisMonth()
start_date = datetime.datetime.now().strftime('%Y-%m-01T00:00:00')
end_date = datetime.datetime.now().strftime('%Y-%m-%dT00:00:00')
total_used = info_service.getUnitCount(SOAPpy.Types.untypedType(start_date),
                                       SOAPpy.Types.untypedType(end_date))

Code sample not available.
64
65
66
67
68
69
70
71
72
# Get quota usage.
total_limit = info_service.getUsageQuotaThisMonth(nil
  ).getUsageQuotaThisMonthReturn
free_quota_limit = info_service.getFreeUsageQuotaThisMonth(nil
  ).getFreeUsageQuotaThisMonthReturn
start_date = DateTime.now.strftime('%Y-%m-01')
end_date = DateTime.now.strftime('%Y-%m-%d')
total_used = info_service.getUnitCount(:startDate => start_date,
  :endDate => end_date).getUnitCountReturn

Code sample not available.
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Get quota usage.
$request_xml = '<getUsageQuotaThisMonth></getUsageQuotaThisMonth>';
$total_limit = $info_service->call('getUsageQuotaThisMonth', $request_xml);
$total_limit = $total_limit['getUsageQuotaThisMonthReturn'];
if ($debug) show_xml($info_service);
if ($info_service->fault) show_fault($info_service);

$request_xml = '<getFreeUsageQuotaThisMonth></getFreeUsageQuotaThisMonth>';
$free_quota_limit = $info_service->call('getFreeUsageQuotaThisMonth');
$free_quota_limit = $free_quota_limit['getFreeUsageQuotaThisMonthReturn'];
if ($debug) show_xml($info_service);
if ($info_service->fault) show_fault($info_service);

$request_xml =
  '<getUnitCount>' .
  '<startDate>2008-01-01</startDate><endDate>2008-01-31</endDate>' .
  '</getUnitCount>';
$total_used = $info_service->call('getUnitCount', $request_xml);
$total_used = $total_used['getUnitCountReturn'];

Code sample not available.
Select a programming language to view its sample

getUnitCountForClients

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

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.
startDate date
The beginning of the date range, inclusive.
endDate date
The end of the date range, inclusive.

Response

ClientUsageRecord[] 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

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

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

long the total number of API units, including free units, for this entire month, for the developer token being used to make this call.

Samples

Code sample not available.
58
59
60
61
62
63
      // 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());

Code sample not available.
55
56
57
58
59
60
        // 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));

Code sample not available.
62
63
64
65
66
67
68
69
70
71
72
# Get quota usage.
my $total_limit = $service->call('getUsageQuotaThisMonth' => @headers)
  ->result();
my $free_quota_limit = $service->call('getFreeUsageQuotaThisMonth' =>
  @headers)->result();
my $start_date = SOAP::Data->name('startDate' =>
  POSIX::strftime('%Y-%m-01T00:00:00', localtime()));
my $end_date = SOAP::Data->name('endDate' =>
  POSIX::strftime('%Y-%m-%dT00:00:00', localtime()));
my $total_used = $service->call('getUnitCount' => $start_date, $end_date,
  @headers)->result();

Code sample not available.
49
50
51
52
53
54
55
# Get quota usage.
total_limit = info_service.getUsageQuotaThisMonth()
free_quota_limit = info_service.getFreeUsageQuotaThisMonth()
start_date = datetime.datetime.now().strftime('%Y-%m-01T00:00:00')
end_date = datetime.datetime.now().strftime('%Y-%m-%dT00:00:00')
total_used = info_service.getUnitCount(SOAPpy.Types.untypedType(start_date),
                                       SOAPpy.Types.untypedType(end_date))

Code sample not available.
64
65
66
67
68
69
70
71
72
# Get quota usage.
total_limit = info_service.getUsageQuotaThisMonth(nil
  ).getUsageQuotaThisMonthReturn
free_quota_limit = info_service.getFreeUsageQuotaThisMonth(nil
  ).getFreeUsageQuotaThisMonthReturn
start_date = DateTime.now.strftime('%Y-%m-01')
end_date = DateTime.now.strftime('%Y-%m-%d')
total_used = info_service.getUnitCount(:startDate => start_date,
  :endDate => end_date).getUnitCountReturn

Code sample not available.
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Get quota usage.
$request_xml = '<getUsageQuotaThisMonth></getUsageQuotaThisMonth>';
$total_limit = $info_service->call('getUsageQuotaThisMonth', $request_xml);
$total_limit = $total_limit['getUsageQuotaThisMonthReturn'];
if ($debug) show_xml($info_service);
if ($info_service->fault) show_fault($info_service);

$request_xml = '<getFreeUsageQuotaThisMonth></getFreeUsageQuotaThisMonth>';
$free_quota_limit = $info_service->call('getFreeUsageQuotaThisMonth');
$free_quota_limit = $free_quota_limit['getFreeUsageQuotaThisMonthReturn'];
if ($debug) show_xml($info_service);
if ($info_service->fault) show_fault($info_service);

$request_xml =
  '<getUnitCount>' .
  '<startDate>2008-01-01</startDate><endDate>2008-01-31</endDate>' .
  '</getUnitCount>';
$total_used = $info_service->call('getUnitCount', $request_xml);
$total_used = $total_used['getUnitCountReturn'];

Code sample not available.
12
13
14
    <!-- 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/>

Select a programming language to view its sample