You can you the following curl commands to add and update APIs with query parameters.
ADD API
curl -X POST -b cookies
http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag -d
"action=addAPI&name=PhoneVerification&context=/phoneverify&version=1.0.0&visibility=public&thumbUrl=&description=Verify
a phone
number&tags=phone,mobile,multimedia&endpointType=nonsecured&tiersCollection=Gold,Bronze&http_checked=http&https_checked=https&default_version_checked=default_version&bizOwner=xx&[email protected]&techOwner=xx&[email protected]"
-d 'endpoint_config={"production_endpoints":{"url":"http://ws.cdyne.com/phoneverify/phoneverify.asmx","config":null},"endpoint_type":"http"}'
-d 'swagger={"paths" : {"/CheckPhoneNumber" : {"post" : {"x-auth-type" : "Application%20%26%20Application%20User", "x-scope" : "read_number",
"x-throttling-tier" : "Unlimited", "responses" : {"200" : {}}}, "get"
: {"x-auth-type" : "Application%20%26%20Application%20User",
"x-throttling-tier" : "Unlimited", "responses" : {"200" : {}},
"parameters" : [{"name" : "PhoneNumber", "paramType" : "query",
"required" : false, "type" : "string", "description" : "Phone Number",
"in" : "query"}, {"name" : "LicenseKey", "paramType" : "query",
"required" : false, "type" : "string", "description" : "License Key",
"in" : "query"}]}}, "/" : {"put" : {"responses" : {"200" : {}}}, "get"
: {"responses" : {"200" : {}}}}}, "swagger" : "2.0",
"securityDefinitions" : {"apim" : {"x-wso2-scopes" : [{"description" :
"", "name" : "read_number", "roles" : "admin", "key" :
"read_number"}]}}, "info" : {"title" : "PhoneVerification", "version"
: "1.0.0"}}'
`
UPDATE API
curl -X POST -b cookies
http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag -d
"action=updateAPI&name=PhoneVerification&context=/phoneverify&version=1.0.0&visibility=public&thumbUrl=&description=Verify
a phone
number&tags=phone,mobile,multimedia&endpointType=nonsecured&tiersCollection=Gold,Bronze&http_checked=http&https_checked=https&default_version_checked=default_version&bizOwner=xx&[email protected]&techOwner=xx&[email protected]"
-d 'endpoint_config={"production_endpoints":{"url":"http://ws.cdyne.com/phoneverify/phoneverify.asmx","config":null},"endpoint_type":"http"}'
-d 'swagger={"paths" : {"/CheckPhoneNumber" : {"post" : {"x-auth-type" : "Application%20%26%20Application%20User", "x-scope" : "read_number",
"x-throttling-tier" : "Unlimited", "responses" : {"200" : {}}}, "get"
: {"x-auth-type" : "Application%20%26%20Application%20User",
"x-throttling-tier" : "Unlimited", "responses" : {"200" : {}},
"parameters" : [{"name" : "PhoneNumberCHANGED", "paramType" : "query",
"required" : false, "type" : "string", "description" : "Phone Number",
"in" : "query"}, {"name" : "LicenseKeyCHANGED", "paramType" : "query",
"required" : false, "type" : "string", "description" : "License Key",
"in" : "query"}]}}, "/" : {"put" : {"responses" : {"200" : {}}}, "get"
: {"responses" : {"200" : {}}}}}, "swagger" : "2.0",
"securityDefinitions" : {"apim" : {"x-wso2-scopes" : [{"description" :
"", "name" : "read_number", "roles" : "admin", "key" :
"read_number"}]}}, "info" : {"title" : "PhoneVerification", "version"
: "1.0.0"}}'