WSO2 API Manager: need to create API from backend using swagger file - wso2

I have a requirement where I need to create APIs in wso2 api manager using swagger file for an API. Also, this should be created from backend.
I have been able to create APIs from backend as per the link https://docs.wso2.com/display/AM1100/apidocs/publisher/#!/operations#APICollection#apisPost
but it does not take swagger file for an API. How can I create an API using swagger file from backend.
Please help as I am stuck here.
Thanks

This cannot be done. You will have to follow the payload definition which is defined in the Post request.
Even if you try to import a Swagger file in API Manager publisher, still you need to manually change the API name, throttling policies and etc when creating the API.

Related

WSO2 AM API DOCS - Is there a way to use swagger as API Documentation in DevPortal?

The company that i work for is developing an API to allow an integration with our applications. We're using WSO2 AM as our gateway. I hava to document the API and they want me to use WSO2 devportal to do so. But the problem is that they also wanna use Swagger to create this documentation. Is there a way to add Swagger in the API Docs?
One workaround would be, you can add document type of Markdown and add the swagger content as code.
So it can be viewed from Devportal as shown below:

WSO2 API Manager download API Definition

Is there a way to download API definition (JSON or YML) from Developer Portal? I mean, is there any default link I can point to get this file from API or API Product?
PS: It is easy to do it from Publisher interface but I can't find any option on DP.
Thanks!
You can download the API definition from the Devportal as well. Click on the Swagger as in the following image.

WSO2 APIM - api file deployment

deploying the WSO2 APIM 2.1.0 using puppet, we consider to deploy the API itself with the CICD as well.
In theory - I could copy (template) the synapse files (proxy, api) and the api is available for the call, however - the API is not visible in the store. I assume there's more data in the database than just a synapse config file.
Is there a way to define / deploy API (including to the store) using the configuration files or it needs to be done manually?
Edit:
I thought there's a way to deploy API using the API Admin Services. But when calling addAPI with the metadata XML, looks ok. But trying to see the API in the publisher throws an exception
ERROR - index:jag org.wso2.carbon.apimgt.api.APIManagementException: Unable to find the API: admin-myapi-v1.0.0 in the database
Thank you for any hint
g.
Based on your requirements it looks like you can use one of the following options.
Migrate APIs - You can export APIs from one environment and import those APIs to the new environment. When you import APIs in the new environment, those APIs will be in created state. You need to manually publish those APIs. May be using the jaggery API or REST API you will be able to publish the APIs.
REST API
Jaggery API - This is deprecated at the moment and discourage for using this.
Once you create the APIs, APIs related details will be saved in the database. Additionally, synapse configuration can be found in the file system. If you point the previous database to the new deployment and deploy the synapse artifacts, APIs will work. But then again API creation/publishing and entire flow will not be tested. For CICD, you need to consider above mentioned options. In the future releases, there is more focus towards the REST API and it will be more useful for the CICD.

Application as an API in WSO2API 1.7

I have published an application as API in WSO2 api manager.So when subscriber visits the wso2 store and opens the api,should be able to see the result(call to the restful service deployed) as though a JSON response.Currently as the subscriber opens the api, they are only able to see the API details with the Production and Sandbox urls which they do not understand how to be used.Isn't there a way I may allow them to open up into a front end UI message which the user understands to go ahead rather than arriving at a new place which is not understood.or any better way of handling it.
Product you need for this is WSO2 APP Manager. not API manager

Non authenticated API in WSO API Manager 1.9?

I am using WSO2 API Manager 1.9 version .I created many APIs and all working fine.As per the requirement now i need a non authenticated API.How to create in API manger ,any suggestion ?
When you create an API, in the Manage tap, you can select No Authentication for an API resource, as shown below.