0
votes

I am following the below steps to get the subscriptions per application.

  1. curl -X POST -c cookies http://localhost:9763/store/site/blocks/user/login/ajax/login.jag -d 'action=login&username=random&password=random

Now logged in and got the cookie details.

2.curl -b cookies 'http://localhost:9763/store/site/blocks/subscription/subscription-list/ajax/subscription-list.jag?action=getSubscriptionByApplication&app=App1'

Now , I am getting the subscriptions for the application App1 which has subscriber by the user admin not random.

Why this API thorws admin subscription instead of the particular user even though we are posting the request with the use of cookies. Please help.

1
did you subscribe to App1 via user random?Fazlan Nazeem
Just a related note: Those APIs are now deprecated and new REST APIs are recommended. pub: docs.wso2.com/display/AM200/apidocs/publisher store: docs.wso2.com/display/AM200/apidocs/storeBee
Fazlan : Yes I have subscribed using App1 via user random..user6502610
@Bhathiya - I am using version 1.10.0. It should work right then.user6502610

1 Answers

1
votes

The following curl request will List all API subscriptions of App1.

Request

.curl -b cookies 'http://localhost:9763/store/site/blocks/subscription/subscription-list/ajax/subscription-list.jag?action=getSubscriptionByApplication&app=App1'

Response

{"error" : false, "apis" : [{"apiName" : "CalculatorAPI", "apiVersion" : "1.0", "apiProvider" : "admin", "description" : "Simple calculator API to perform addition, subtraction, multiplication and division.", "subscribedTier" : "Unlimited", "status" : "PUBLISHED", "subStatus" : "UNBLOCKED"}]}

The response does not have a field for subscribedUsers

Hence I assume what you saw as admin was the apiProvider.