How to create an API in WSO2 Publisher via curl, using an url to swagger documentation?
In WSO2 APIM 1.10.0 ++ there is a bunch of RESTful APIs to achieve this. I tried via the REST APIs passing in the Swagger JSON and it picks up the API name, context etc accurately: hence such a call would create your API. E.g below
curl -H "Authorization: Bearer <token>" -H "Content-Type: application/json" -X POST -d @data.json http://127.0.0.1:9763/api/am/publisher/v0.9/apis
data.json
has the following among other elements:
"provider": "admin", "version": "1.0.0", "description": "Verify a phone number", "name": "PhoneVerification3", "context": "/phoneverify3"
See here for the API:
https://docs.wso2.com/display/AM1100/apidocs/publisher/#!/operations#APIsApi#apisGet