Got it working with the following payload

{
   "name": "TaskDetails",
   "description": "This document describe a RESTFul API for TestAPIfromREST
API.\r\n",
   "context": "tasks",
   "version": "1.0.0",
   "provider":"Administrator",

"apiDefinition":"{\"swagger\":\"2.0\",\"paths\":{\"/task/{id}\":{\"get\":{\"responses\":{\"200\":{\"description\":\"this
is
test\"}},\"parameters\":[{\"name\":\"id\",\"in\":\"path\",\"allowMultiple\":false,\"required\":true,\"type\":\"string\"}],\"x-auth-type\":\"Application
& Application
User\",\"x-throttling-tier\":\"Unlimited\"}}},\"info\":{\"title\":\"TaskDetails\",\"version\":\"1.0.0\"}}",

   "isDefaultVersion": false,
   "type": "HTTP",
   "transport":    [
      "http",
      "https"
   ],
   "tiers": ["Unlimited"],
   "visibility": "PUBLIC",
   "endpointConfig": "{\"production_endpoints\":{\"url\":\"
http://localhost:8080//sample-data-backend/rservice/taskservice/\",\"config\":null},\"sandbox_endpoints\":{\"url\":\"/sample-data-backend/rservice/taskservice/\",\"config\":null},\"endpoint_type\":\"http\"}";,

   "sequences":[{"name":"custom-in","type": "in","id":
"/_system/governance/apimgt/customsequences/in/custom-in.xml"},{"name":"custom-out","type":
"out","id":
"/_system/governance/apimgt/customsequences/out/custom-out.xml"}],
   "subscriptionAvailability": "current_tenant",
   "subscriptionAvailableTenants": null
}

Thanks for your help!!!

On Mon, Jan 22, 2018 at 3:05 PM, Chathurika De Silva <chathuri...@wso2.com>
wrote:

> Thank you both for the information. Will try it.
>
>
>
> On Mon, Jan 22, 2018 at 2:59 PM, Abimaran Kugathasan <abima...@wso2.com>
> wrote:
>
>> Hi Chathurika,
>>
>> If you have already added the sequence to registry through the registry
>> APIs, then you can use sequence parameter to populate it in the API
>> creation time, otherwise, you will have to create the API first and upload
>> the sequence through the API mentioned by Praminda.
>>
>> On Mon, Jan 22, 2018 at 2:47 PM, Chathurika De Silva <
>> chathuri...@wso2.com> wrote:
>>
>>> Hi Praminda
>>>
>>> Thank you. I will try this. Since the payload in [1] consists of a
>>> parameter called "sequence" it was bit confusing.
>>>
>>> [1] https://docs.wso2.com/display/AM210/apidocs/publisher/#!/models#API
>>>
>>> On Mon, Jan 22, 2018 at 2:43 PM, Praminda Jayawardana <prami...@wso2.com
>>> > wrote:
>>>
>>>> Hi Erandi,
>>>>
>>>> I don't think you can attach a sequence at API creation. However did
>>>> you try [1] which is the API for adding a mediation sequence to existing
>>>> API?
>>>>
>>>> [1]: https://docs.wso2.com/display/AM210/apidocs/publisher/#!/ope
>>>> rations#MediationPolicyCollection#apisApiIdPoliciesMediationPost
>>>>
>>>> Thanks,
>>>> Praminda
>>>>
>>>> On Mon, Jan 22, 2018 at 2:31 PM, Chathurika De Silva <
>>>> chathuri...@wso2.com> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> There is a need to create/update an api with a custom sequence
>>>>> associated through the REST APIs. In [1] the sample payload has a field
>>>>> called sequences which is taking an array as the argument. But from the
>>>>> document it's not clear how to proceed with it (whether we need to first
>>>>> upload the sequence to the registry, etc...) It would be highly 
>>>>> appreciated
>>>>> if a sample can be pointed out that addresses the $subject need.
>>>>>
>>>>> [1] https://docs.wso2.com/display/AM210/apidocs/publisher/#!/ope
>>>>> rations#APIIndividual#apisApiIdPut
>>>>>
>>>>> Thanks
>>>>> Erandi
>>>>>
>>>>> --
>>>>> *Chathurika Erandi*
>>>>> Senior Software Engineer,
>>>>> WSO2 Inc.
>>>>>
>>>>> *E-mail:* chathuri...@wso2.com
>>>>> *Mobile: *+94714 328 612
>>>>> *Blog*: chathurikaerandi.blogspot.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *Praminda Jayawardana*
>>>> Software Engineer
>>>> WSO2 Inc.; http://wso2.com
>>>> Mobile : +94 (0) 716 590918 <+94%2071%20659%200918>
>>>>
>>>
>>>
>>>
>>> --
>>> *Chathurika Erandi*
>>> Senior Software Engineer,
>>> WSO2 Inc.
>>>
>>> *E-mail:* chathuri...@wso2.com
>>> *Mobile: *+94714 328 612
>>> *Blog*: chathurikaerandi.blogspot.com
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Thanks
>> Abimaran Kugathasan
>> Senior Software Engineer - API Technologies
>>
>> Email : abima...@wso2.com
>> Mobile : +94 773922820 <+94%2077%20392%202820>
>>
>> <http://stackoverflow.com/users/515034>
>> <http://lk.linkedin.com/in/abimaran>
>> <http://www.lkabimaran.blogspot.com/>  <https://github.com/abimarank>
>> <https://twitter.com/abimaran>
>>
>>
>
>
> --
> *Chathurika Erandi*
> Senior Software Engineer,
> WSO2 Inc.
>
> *E-mail:* chathuri...@wso2.com
> *Mobile: *+94714 328 612
> *Blog*: chathurikaerandi.blogspot.com
>



-- 
*Chathurika Erandi*
Senior Software Engineer,
WSO2 Inc.

*E-mail:* chathuri...@wso2.com
*Mobile: *+94714 328 612
*Blog*: chathurikaerandi.blogspot.com
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to