Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Localtabgroup
Localtab
activetrue
titleRequest
HTTP request methodGET
URL

https://gateway.api.cloud.wso2.com/api/logs?logType=<log-type>&date=<yyyy-mm-dd>

The following table describes the valid logType and date values that you can pass in the URL:

ParameterValid values
logType

Either load-balancer or gateway.

date
The current date or a prior date in the following format:

yyyy-mm-dd in Pacific Standard Time
For example, 2019-03-20.

Note
titleNote

Specifying a future date is not valid and will result in an unsuccessful invocation.

Headers

Content-Type: application/json
Authorization: Bearer <Bearer token received by following prerequisites>

Localtab
titleResponse
Localtabgroup
Localtab
activetrue
titleSuccessful invocation
Code Block
{
   “archiveFileUrl” : “https://link-to-archive-file”,
   “validPeriodInSeconds” : 300
}
Localtab
titleUnsuccessful invocation
Code Block
{
 "message": <An error message describing the reason that caused an unsuccesful invocation>
}

REST APIs that can be invoked with a subscriber access token

API Store statistics API

...

activetrue
titleRequest

...

Content-Type: application/json
Authorization: Bearer <Bearer token received by following prerequisites>

...

Code Block
{
	"statisticsType" : "getProviderAPIUsage",
	"toDate":"2018-02-22 17:11",
	"fromDate": "2016-09-28 00:00"
}
ParameterDescription
statisticsType

The type of statistics you need to retrieve for a particular time period.

  • getTopAppUsers - Top Users For Applications

  • getAppApiCallType - API Usage from Resource Path

  • getPerAppAPIFaultCount - Faulty Invocations per Application

  • getProviderAPIUsage - API Usage per Application

toDate
The end date of the required period.
fromDate
The start date of the required period.
Localtab
titleResponse

Note that your response will differ according to the requested type of statistics. A succesful invocation would be similar to the sample given below.

Code Block
titleSuccessful invocation
{  
   "success":true,
   "message":"Successfully retrieved the statistics data for the statistics type getTopAppUsers for the user sam@wso2.com@testcompany",
"data":"[{\"appName\":\"iot_ui_testcompany\",\"userCountArray\":[{\"count\":52,\"user\":\"sam@wso2.com@testcompany\"}]}]"
}