Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated heading to reflect in the TOC

...

DescriptionCheck if the user logged in user is any one in a given list of users
URI

 https:// api.cloud.wso2.com /publisher/site/blocks/item-add/ajax/add.jag

URI Parameters

action=validateRoles&roles=<list of roles>

HTTP MethodsGET
Example

curl -b cookies "  https:// api.cloud.wso2.com /publisher/site/blocks/item-add/ajax/add.jag?action=validateRoles&roles=admin"

Get List of API Creators

DescriptionGet the list of all the API creators.
URI

https://api.cloud.wso2.com/publisher/site/blocks/stats/api-usage-user/ajax/stats.jag

Request Headers

"Content-Type" -> "application/x-www-form-urlencoded"
“Cookie” -> “JSESSIONID=29FCD6CF81BED3701B2F0FD00A7D14B6574F6BF4AF4F4A4D3E6DA7CE1DB8AC82882E3CDBE32C2037AF6F6FCB926B0F649E5833EC2D7AA07FC3A56654883CB972C3F6910B6100C5C7DF5386D3CE2F20316B779550BDE58F40160C48BCC8E189EB0EDFAEF671B7787BBC4767E3FDCC8BFB80DC658578A1D157901F3FFF76858C7B; Path=/publisher/; Secure; HttpOnly”

HTTP MethodsPOST
Payloadaction=getAPIUsageByUser&currentLocation=/publisher/site/pages/all-statistics.jag&fromDate=2014-05-10 00:00:00&toDate=2016-12-16 13:41:13&apiFilter=allAPIs
Example

curl -v -b cookies -XPOST -H "Content-type: application/x-www-form-urlencoded" -d 'action=getAPIUsageByUser&currentLocation=/publisher/site/pages/all-statistics.jag&fromDate=2014-05-10 00:00:00&toDate=2016-12-16 13:41:13&apiFilter=allAPIs' ' https://api.cloud.wso2.com/publisher/site/blocks/stats/api-usage-user/ajax/stats.jag '

Sample Response

< HTTP/1.1 200 OK
< Server: nginx
< Date: Mon, 09 Jan 2017 05:13:07 GMT
< Content-Type: application/json;charset=UTF-8
< Content-Length: 239
< Connection: keep-alive
< Strict-Transport-Security: max-age=15768000
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
<
* Connection #0 to host api.cloud.wso2.com left intact
{"error" : false, "usage" : [{"apiName" : "buzzwordapi", "version" : "1.0.0", "userID" : "sabra.wso2.com@sabraorg", "count" : 14}, {"apiName" : "buzzwordapinew", "version" : "1.0.0", "userID" : "sabra.wso2.com@sabraorg", "count" : 1}]}

Get Subscriber Count

DescriptionGet the number of subscribers.
URI

https://api.cloud.wso2.com/publisher/site/blocks/stats/api-subscriptions/ajax/stats.jag

Request Headers

"Content-Type" -> "application/x-www-form-urlencoded"
“Cookie” -> “JSESSIONID=29FCD6CF81BED3701B2F0FD00A7D14B6574F6BF4AF4F4A4D3E6DA7CE1DB8AC82882E3CDBE32C2037AF6F6FCB926B0F649E5833EC2D7AA07FC3A56654883CB972C3F6910B6100C5C7DF5386D3CE2F20316B779550BDE58F40160C48BCC8E189EB0EDFAEF671B7787BBC4767E3FDCC8BFB80DC658578A1D157901F3FFF76858C7B; Path=/publisher/; Secure; HttpOnly”

HTTP MethodsPOST
Payload

action:getSubscriberCountByAPIs
currentLocation:/publisher/site/pages/all-statistics.jag
apiFilter:allAPIs

Example

curl  -v -b cookies -XPOST -H "Content-type: application/x-www-form-urlencoded" -d 'action=getSubscriberCountByAPIs&currentLocation=/publishe/site/pages/all-statistics.jag&apiFilter=allAPIs' 'https://api.cloud.wso2.com/publisher/site/blocks/stats/api-subscriptions/ajax/stats.jag'

Sample Response

< HTTP/1.1 200 OK
< Server: nginx
< Date: Mon, 09 Jan 2017 05:15:49 GMT
< Content-Type: application/json;charset=UTF-8
< Content-Length: 198
< Connection: keep-alive
< Strict-Transport-Security: max-age=15768000
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
<
* Connection #0 to host api.cloud.wso2.com left intact
{"error" : false, "usage" : [{"apiName" : ["buzzwordapi", "1.0.0", "sabra.wso2.com-AT-sabraorg"], "count" : 2}, {"apiName" : ["buzzwordapinew", "1.0.0", "sabra.wso2.com-AT-sabraorg"], "count" : 2}]}

Get API Usage By Resource Path

DescriptionGet the API usage based on the resource path.
URI

https://api.cloud.wso2.com/publisher/site/blocks/stats/api-usage-resource-path/ajax/stats.jag

Request Headers

"Content-Type" -> "application/x-www-form-urlencoded"
“Cookie” -> “JSESSIONID=29FCD6CF81BED3701B2F0FD00A7D14B6574F6BF4AF4F4A4D3E6DA7CE1DB8AC82882E3CDBE32C2037AF6F6FCB926B0F649E5833EC2D7AA07FC3A56654883CB972C3F6910B6100C5C7DF5386D3CE2F20316B779550BDE58F40160C48BCC8E189EB0EDFAEF671B7787BBC4767E3FDCC8BFB80DC658578A1D157901F3FFF76858C7B; Path=/publisher/; Secure; HttpOnly”

HTTP MethodsPOST
Payload

action:getAPIUsageByResourcePath
currentLocation:/publisher/site/pages/all-statistics.jag
fromDate:2014-05-10 00:00:00
toDate:2016-12-16 14:34:33
apiFilter:allAPIs

Example

curl -v -b cookies -XPOST -H "Content-type: application/x-www-form-urlencoded" -d 'action=getAPIUsageByResourcePath&currentLocation=%2Fpublisher%2Fsite%2Fpages%2Fall-statistics.jag&fromDate=2014-05-10+00%3A00%3A00&toDate=2016-12-16+14%3A34%3A33&apiFilter=allAPIs' 'https://api.cloud.wso2.com/publisher/site/blocks/stats/api-usage-resource-path/ajax/stats.jag'

Sample Response

< HTTP/1.1 200 OK
< Server: nginx
< Date: Mon, 09 Jan 2017 05:16:59 GMT
< Content-Type: application/json;charset=UTF-8
< Content-Length: 1092
< Connection: keep-alive
< Strict-Transport-Security: max-age=15768000
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
<
{"error" : false, "usage" : [{"apiName" : "buzzwordapi", "version" : "1.0.0", "context" : "/t/sabraorg/buzzwordservice/1.0.0", "method" : "GET", "count" : 2, "time" : "2016-04-08 03:22", "resourcePath" : "/buzzwordservice/1.0.0/all"}, {"apiName" : "buzzwordapi", "version" : "1.0.0", "context" : "/t/sabraorg/buzzwordservice/1.0.0", "method" : "GET", "count" : 8, "time" : "2016-04-25 04:54", "resourcePath" : "/buzzwordservice/1.0.0/all"}, {"apiName" : "buzzwordapi", "version" : "1.0.0", "context" : "/t/sabraorg/buzzwordservice/1.0.0", "method" : "GET", "count" : 1, "time" : "2016-04-08 03:22", "resourcePath" : "/buzzwordservice/1.0.0/mostPopular"}, {"apiName" : "buzzwordapi", "version" : "1.0.0", "context" : "/t/sabraorg/buzzwordservice/1.0.0", "method" : "GET", "count" : 3, "time" : "2016-04-25 04:44", "resourcePath" : "/buzzwordservice/1.0.0/mostPopular"}, {"apiName" : "buzzwordapinew", "version" : "1.0.0", "context" : "/t/sabraorg/buzzwordservicenew/1.0.0", "method" : "GET", "count" : 1, "time" : "2016-05-05* Connection #0 to host api.cloud.wso2.com left intact
05:29", "resourcePath" : "/buzzwordservicenew/1.0.0/mostPopular"}]}

Get API Usage By Destination

DescriptionGet the API usage based on the destination 
URI

https://api.cloud.wso2.com/publisher/site/blocks/stats/api-usage-destination/ajax/stats.jag

Request Headers

"Content-Type" -> "application/x-www-form-urlencoded"
“Cookie” -> “JSESSIONID=29FCD6CF81BED3701B2F0FD00A7D14B6574F6BF4AF4F4A4D3E6DA7CE1DB8AC82882E3CDBE32C2037AF6F6FCB926B0F649E5833EC2D7AA07FC3A56654883CB972C3F6910B6100C5C7DF5386D3CE2F20316B779550BDE58F40160C48BCC8E189EB0EDFAEF671B7787BBC4767E3FDCC8BFB80DC658578A1D157901F3FFF76858C7B; Path=/publisher/; Secure; HttpOnly”

HTTP Methods POST
Payload

action:getAPIUsageByDestination
currentLocation:/publisher/site/pages/all-statistics.jag
fromDate:2014-05-10 00:00:00
toDate:2016-12-16 14:34:33
apiFilter:allAPIs

Example

curl -v -b cookies -XPOST -H "Content-type: application/x-www-form-urlencoded" -d 'action=getAPIUsageByDestination&currentLocation=%2Fpublisher%2Fsite%2Fpages%2Fall-statistics.jag&fromDate=2014-05-10+00%3A00%3A00&toDate=2016-12-16+14%3A34%3A33&apiFilter=allAPIs' 'https://api.cloud.wso2.com/publisher/site/blocks/stats/api-usage-destination/ajax/stats.jag

Sample Response

< HTTP/1.1 200 OK
< Server: nginx
< Date: Fri, 16 Dec 2016 09:22:43 GMT
< Content-Type: application/json;charset=UTF-8
< Content-Length: 359
< Connection: keep-alive
< Strict-Transport-Security: max-age=15768000
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
<
* Curl_http_done: called premature == 0
* Connection #0 to host api.cloud.wso2.com left intact
{"error" : false, "usage" : [{"apiName" : "Cedum", "version" : "1.0.0", "context" : "/t/anuruddha/demo/1.0.0", "destination" : "http://ceduam.cloudapp.net:3000", "count" : 6}, {"apiName" : "PhoneVerification", "version" : "1.0.0", "context" : "/t/anuruddha/phoneverify/1.0.0", "destination" : "http://ws.cdyne.com/phoneverify/phoneverify.asmx", "count" : 1}]}

Get API Usage by Provider

DescriptionGet API Usage by Provider.
URI

https://api.cloud.wso2.com/publisher/site/blocks/stats/api-usage/ajax/stats.jag

Request Headers

"Content-Type" -> "application/x-www-form-urlencoded"
“Cookie” -> “JSESSIONID=29FCD6CF81BED3701B2F0FD00A7D14B6574F6BF4AF4F4A4D3E6DA7CE1DB8AC82882E3CDBE32C2037AF6F6FCB926B0F649E5833EC2D7AA07FC3A56654883CB972C3F6910B6100C5C7DF5386D3CE2F20316B779550BDE58F40160C48BCC8E189EB0EDFAEF671B7787BBC4767E3FDCC8BFB80DC658578A1D157901F3FFF76858C7B; Path=/publisher/; Secure; HttpOnly”

HTTP MethodsPOST
Payload

action:getProviderAPIUsage
currentLocation:/publisher/site/pages/all-statistics.jag
fromDate:2014-05-10 00:00:00
toDate:2016-12-16 14:34:33
apiFilter:allAPIs

Example

curl -v -b cookies -XPOST -H "Content-type: application/x-www-form-urlencoded" -d 'ac
tion=getProviderAPIUsage&currentLocation=%2Fpublisher%2Fsite%2Fpages%2Fall-statistics.jag&fromDate=2014-05-10+00%3A00%3A00&toDate=2016-12-16+14%3A34%3A33&apiFilter=allAPIs' 'https://api.cloud.wso2.com/publisher/site/blocks/stats/api-usage/ajax/stats.jag'

Sample Response

< HTTP/1.1 200 OK
< Server: nginx
< Date: Fri, 16 Dec 2016 09:30:43 GMT
< Content-Type: application/json;charset=UTF-8
< Content-Length: 219
< Connection: keep-alive
< Strict-Transport-Security: max-age=15768000
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
<
* Curl_http_done: called premature == 0
* Connection #0 to host api.cloud.wso2.com left intact
{"error" : false, "usage" : [{"apiName" : "[\"Cedum\",\"1.0.0\",\"anuruddhal.wso2.com-AT-anuruddha\"]", "count" : 8}, {"apiName" : "[\"PhoneVerification\",\"1.0.0\",\"anuruddhal.wso2.com-AT-anuruddha\"]", "count" : 2}]}

Get API and Application Throttling Data

DescriptionGet the throttling related data related to the APIs and applications.
URIhttps://api.cloud.wso2.com/publisher/site/blocks/stats/api-throttledcounts/ajax/stats.jag
Request Headers

"Content-Type" -> "application/x-www-form-urlencoded"
“Cookie” -> “JSESSIONID=29FCD6CF81BED3701B2F0FD00A7D14B6574F6BF4AF4F4A4D3E6DA7CE1DB8AC82882E3CDBE32C2037AF6F6FCB926B0F649E5833EC2D7AA07FC3A56654883CB972C3F6910B6100C5C7DF5386D3CE2F20316B779550BDE58F40160C48BCC8E189EB0EDFAEF671B7787BBC4767E3FDCC8BFB80DC658578A1D157901F3FFF76858C7B; Path=/publisher/; Secure; HttpOnly”

HTTP MethodsPOST
Payload

action:getThrottleDataOfAPIAndApplication
currentLocation:/publisher/site/pages/all-statistics.jag
fromDate:2014-05-10 00:00:00
toDate:2016-12-16 14:34:33
apiFilter:allAPIs
apiName: Cedum
appName:

Examplecurl -v -b cookies -XPOST -H "Content-type: application/x-www-form-urlencoded" -d 'action=getThrottleDataOfAPIAndApplication&currentLocation=%2Fpublisher%2Fsite%2Fpages%2Fall-statistics.jag&apiName=Cedum&appName=&fromDate=2014-05-10+00%3A00%3A00&toDate=2016-12-16+15%3A07%3A00&apiFilter=allAPIs' 'https://api.cloud.wso2.com/publisher/site/blocks/stats/api-throttledcounts/ajax/stats.jag'
Sample Response

< HTTP/1.1 200 OK
< Server: nginx
< Date: Fri, 16 Dec 2016 09:43:04 GMT
< Content-Type: application/json;charset=UTF-8
< Content-Length: 17
< Connection: keep-alive
< Strict-Transport-Security: max-age=15768000
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Set-Cookie: JSESSIONID=AA2ADAFAD614FDDCE276E1E63EA836BBEBF098FA685A4FE6B8BB9110FC1E4B8688C61824325CB24491A78B66ABF30F38AEBB6ACBBBB7400F85FEB4D4C77A9E34AF04C92523149ED8873E8EB4834260D87D8B846684F72CBD5578BAB3B372D8EB648783C09A9DB750231B5515919A17688D8E5DFC05805FBBA3E5D5AB6B38799D; Path=/publisher/; Secure; HttpOnly
<
* Curl_http_done: called premature == 0
* Connection #0 to host api.cloud.wso2.com left intact
{"error" : false}localhost:bin anuruddha$ curl -XPOST -H 'Cookie: JSESSIONID=AA2ADAFAD614FDDCE276E1E63EA836BBEBF098FA685A4FE6B8BB9110FC1E4B8688C61824325CB24491A78B66ABF30F38AEBB6ACBBBB7400F85FEB4D4C77A9E3873E8EB4834260D87D8B846684F72CBD5578BAB3B372D8EB648783C09A9DB750231B5515919A17688D8E5DFC05805FBBA3E5D5AB6B38799D; Path=/publisher/; Secure; HttpOnly' -H "Content-type: application/x-www-form-urlencoded" -d 'action=getThrottleDataOfAPIAndApplication&currentLocation=%2Fpublisher%2Fsite%2Fpages%2Fall-statistics.jag&apiName=Cedum&appName=&fromDate=2014-05-10+00%3A00%3A00&toDate=2016-12-16+15%3A07%3A00&apiFilter=allAPIs' 'https://api.cloud.wso2.com/publisher/site/blocks/stats/api-throttledcounts/ajax/stats.jag'
{"error" : false, "usage" : {"result" : [{"apiName" : "Cedum", "apiPublisher" : "__all_providers__@anuruddha", "successRequestCount" : 2, "throttleOutCount" : 0, "time" : "2016-12-14 00:00:00"}, {"apiName" : "Cedum", "apiPublisher" : "__all_providers__@anuruddha", "successRequestCount" : 6, "throttleOutCount" : 0, "time" : "2016-12-15 00:00:00"}], "groupBy" : "day", "timeUnitMili" : 86400000}}

Get API Response Fault Count

DescriptionGet the response fault count of APIs.
URIhttps://api.cloud.wso2.com/publisher/site/blocks/stats/faulty-invocations/ajax/stats.jag
Request Headers

"Content-Type" -> "application/x-www-form-urlencoded"
“Cookie” -> “JSESSIONID=29FCD6CF81BED3701B2F0FD00A7D14B6574F6BF4AF4F4A4D3E6DA7CE1DB8AC82882E3CDBE32C2037AF6F6FCB926B0F649E5833EC2D7AA07FC3A56654883CB972C3F6910B6100C5C7DF5386D3CE2F20316B779550BDE58F40160C48BCC8E189EB0EDFAEF671B7787BBC4767E3FDCC8BFB80DC658578A1D157901F3FFF76858C7B; Path=/publisher/; Secure; HttpOnly”

HTTP MethodsPOST
Payload

action:getThrottleDataOfAPIAndApplication
currentLocation:/publisher/site/pages/all-statistics.jag
fromDate:2014-05-10 00:00:00
toDate:2016-12-16 14:34:33
apiFilter:allAPIs

Examplecurl -v -b cookies -XPOST -H "Content-type: application/x-www-form-urlencoded" -d 'action=getAPIResponseFaultCount&currentLocation=%2Fpublisher%2Fsite%2Fpages%2Fall-statistics.jag&fromDate=2014-05-10+00%3A00%3A00&toDate=2016-12-16+15%3A07%3A00&apiFilter=allAPIs' 'https://api.cloud.wso2.com/publisher/site/blocks/stats/faulty-invocations/ajax/stats.jag '
Sample Response

< HTTP/1.1 200 OK
< Server: nginx
< Date: Fri, 16 Dec 2016 09:53:17 GMT
< Content-Type: application/json;charset=UTF-8
< Content-Length: 176
< Connection: keep-alive
< Strict-Transport-Security: max-age=15768000
< X-Frame-Options: DENY
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
<
* Curl_http_done: called premature == 0
* Connection #0 to host api.cloud.wso2.com left intact
{"error" : false, "usage" : [{"apiName" : "Cedum", "version" : "1.0.0", "context" : "/t/anuruddha/demo/1.0.0", "faultPercentage" : 12.5, "count" : 1, "totalRequestCount" : 8}]}