subscription-add.jag [1] has
else if (action == "addAPISubscription" && request.getMethod() == 'POST')
which takes application name to make a subscription. It calls the
addAPISubscription method at [2] which calls the jsFunction_addAPISubscription
method of api store hostobject [3]

Hence no need to write a new api.

[1]
https://github.com/wso2-dev/carbon-apimgt/blob/master/components/apimgt/api-store-web/src/site/blocks/subscription/subscription-add/ajax/subscription-add.jag
[2]
https://github.com/wso2-dev/carbon-apimgt/blob/master/components/apimgt/api-store-web/src/modules/subscription/add.jag
[3]
https://github.com/wso2-dev/carbon-apimgt/blob/master/components/apimgt/org.wso2.carbon.apimgt.hostobjects/src/main/java/org/wso2/carbon/apimgt/hostobjects/APIStoreHostObject.java

Thanks,
Tanya

On Mon, Nov 17, 2014 at 2:17 PM, Sanjeewa Malalgoda <sanje...@wso2.com>
wrote:

> It seems you need to expose API to pass *Application name* and user name
> here. Previously mentioned action require *application ID*.
> So we may be able to keep current API as it is and add new action as you
> mentioned. So users who use existing rest API do not have
> to change their application code.
>
> Thanks,
> sanjeewa.
>
> On Mon, Nov 17, 2014 at 1:54 PM, Sanjeewa Malalgoda <sanje...@wso2.com>
> wrote:
>
>>
>>
>> On Mon, Nov 17, 2014 at 1:36 PM, Tanya Madurapperuma <ta...@wso2.com>
>> wrote:
>>
>>> Isn''t the *addAPISubscription* action in subscription-add.jag does the
>>> same?
>>>
>> +1. Yes we may use same
>>
>> Thanks,
>> sanjeewa.
>>
>>> Thanks,
>>> Tanya
>>>
>>> On Mon, Nov 17, 2014 at 12:32 PM, Roshan Wijesena <ros...@wso2.com>
>>> wrote:
>>>
>>>> Hi Devs,
>>>>
>>>> Current existing addSubscription API [1] accept Application Id as a
>>>> parameter in POST request. It seems, use an internal  attribute as an API
>>>> parameter would not be a good approach.
>>>>
>>>> Further, I would like to propose a new API, which will take application
>>>> name and user name  as  parameters instead of application ID. Sample curl
>>>> request for the proposed API will be as below.
>>>>
>>>> curl -X POST -b cookies
>>>> http://localhost:9763/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag
>>>>  -d
>>>> 'action=addSubscriptionByName&name=API1&version=v1&provider=admin&tier=Gold&applicationName=PizzaShop&userName=admin'
>>>>
>>>> WDYT?
>>>>
>>>> [1] https://docs.wso2.com/display/AM170/Store+APIs.
>>>>
>>>> Regards
>>>> Roshan.
>>>>
>>>> --
>>>> Roshan Wijesena.
>>>> Senior Software Engineer-WSO2 Inc.
>>>> Mobile: *+94752126789*
>>>> Email: ros...@wso2.com
>>>> *WSO2, Inc. :** wso2.com <http://wso2.com/>*
>>>> lean.enterprise.middleware.
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> Dev@wso2.org
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Tanya Madurapperuma
>>>
>>> Software Engineer,
>>> WSO2 Inc. : wso2.com
>>> Mobile : +94718184439
>>> Blog : http://tanyamadurapperuma.blogspot.com
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>>
>> *Sanjeewa Malalgoda*
>> WSO2 Inc.
>> Mobile : +94713068779
>>
>>  <http://sanjeewamalalgoda.blogspot.com/>blog
>> :http://sanjeewamalalgoda.blogspot.com/
>> <http://sanjeewamalalgoda.blogspot.com/>
>>
>>
>>
>
>
> --
>
> *Sanjeewa Malalgoda*
> WSO2 Inc.
> Mobile : +94713068779
>
>  <http://sanjeewamalalgoda.blogspot.com/>blog
> :http://sanjeewamalalgoda.blogspot.com/
> <http://sanjeewamalalgoda.blogspot.com/>
>
>
>


-- 
Tanya Madurapperuma

Software Engineer,
WSO2 Inc. : wso2.com
Mobile : +94718184439
Blog : http://tanyamadurapperuma.blogspot.com
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to