Publisher APIs
Publisher APIs provide the following REST resources.
Note: When you access any API other than the login and logout APIs through an external REST client such as cURL, first invoke the login API to ensure that user is authenticated. When the login API is invoked, the system stores the generated session cookie in a file, which we use in the next API invocations.
The responses is a JSON message.
Login
Description | Log in to API Publisher web application. |
URI | http://localhost:9763/publisher/site/blocks/user/login/ajax/login .jag |
URI Parameters | action=login&username=xxx&password=xxx |
HTTP Methods | POST |
Example | curl -X POST -c cookies http://localhost:9763/publisher/site/blocks/user/login/ajax/login.jag -d 'action=login&username=admin&password=admin' |
Logout
Description | Log out from API Publisher web application. |
URI | http://localhost:9763/publisher/site/blocks/user/login/ajax/login .jag |
URI Parameters | ?action=logout |
HTTP Methods | GET |
Example | curl -b cookies http://localhost:9763/publisher/site/blocks/user/login/ajax/login.jag?action=logout |
Add API
Description | Add a new API. | ||||||||||||||||||||||||||||||||||||||||
URI | http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag | ||||||||||||||||||||||||||||||||||||||||
URI Parameters | Given below are the parameters that you can pass with an Add-API call. Mandatory ones are marked with a *.
| ||||||||||||||||||||||||||||||||||||||||
HTTP Methods | POST | ||||||||||||||||||||||||||||||||||||||||
Example | 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&wsdl=&wadl=&tiersCollection=Gold,Bronze&http_checked=http&https_checked=https&resourceCount=0&resourceMethod-0=GET&resourceMethodAuthType-0=Application&resourceMethodThrottlingTier-0=Unlimited&uriTemplate-0=/*&default_version_checked=default_version&bizOwner=xx&bizOwnerMail=xx@ee.com&techOwner=xx&techOwnerMail=ggg@ww.com" -d'endpoint_config={"production_endpoints":{"url":" http://ws.cdyne.com/phoneverify/phoneverify.asmx","config":null},"endpoint_type":"http "}'; |
Update API
Description | Update an existing API. |
URI | http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag |
URI Parameters | Update API: Parameters are same as in Add API except that action=updateAPI and you can only update the following parameters: visibility, t humbUrl, description, tags, endpointType, endpoint_config (can change the endpoint URL etc,) http_checked, https_checked, wsdl, wadl, tier, tiersCollection and can also add new resources. See example below. |
HTTP Methods | POST |
Example | Update API : curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag -d "action=updateAPI&name=PhoneVerification&provider=admin&version=1.0.0&visibility=public&description=Youtube Live Feeds&endpointType=nonsecured&http_checked=http&https_checked=https&&wsdl=&tags=youtube,gdata,multimedia&tier=Silver&thumbUrl=http://www.10bigideas.com.au/www/573/files/pf-thumbnail-youtube_logo.jpg&context=/youtube&tiersCollection=Gold,Silver&resourceCount=0&resourceMethod-0=GET&resourceMethodAuthType-0=Application&resourceMethodThrottlingTier-0=Unlimited&uriTemplate-0=/*" -d'endpoint_config={"production_endpoints":{"url":"http://gdata.youtube.com/feeds/api/standardfeeds","config":null},"endpoint_type":"http"}'; |
Get All APIs
Description | Lists all the created APIs. |
URI | http://localhost:9763/publisher/site/blocks/listing/ajax/item-list.jag |
URI Parameters | ?action=getAllAPIs |
HTTP Methods | GET |
Example | curl -b cookies http://localhost:9763/publisher/site/blocks/listing/ajax/item-list.jag?action=getAllAPIs |
Get an API
Description | Get details of a specific API. |
URI | http://localhost:9763/publisher/site/blocks/listing/ajax/item-list.jag |
URI Parameters | action=getAPI&name=xxx&version=xxx&provider=xxx |
HTTP Methods | POST |
Example | curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/listing/ajax/item-list.jag -d "action=getAPI&name=PhoneVerification&version=1.0.0&provider=admin" |
Remove an API
Description | Remove an API. |
URI | http://localhost:9763/publisher/site/blocks/item-add/ajax/remove.jag |
URI Parameters | action=removeAPI&name=xxx&version=xxx&provider=xxx |
HTTP Methods | POST |
Example | curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/item-add/ajax/remove.jag -d "action=removeAPI&name=PhoneVerification&version=1.0.0&provider=admin" |
Copy an API
Description | Copy an API to a newer version. |
URI | http://localhost:9763/publisher/site/blocks/overview/ajax/overvi ew.jag |
URI Parameters | action=createNewAPI&provider=xxx&apiName=xxx&version=xxx&newVersion=xxx |
HTTP Methods | POST |
Example | curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/overview/ajax/overview.jag -d "action=createNewAPI&provider=admin&apiName=PhoneVerification&version=1.0.0&newVersion=2.0.0&isDefaultVersion=default_version" |
Check Older Version
Description | Does older version of API exist. |
URI | http://localhost:9763/publisher/site/blocks/life-cycles/ajax/life-cycles .jag |
URI Parameters | ?action=isAPIOlderVersionExist&provider=xxx&name=xxx&version=xxx |
HTTP Methods | POST |
Example | curl -X POST -b cookies http:publisher/site/blocks/life-cycles/ajax/life-cycles.jag?action=isAPIOlderVersionExist&provider=admin&name=PhoneVerification&version=1.0.0 |
Change API Status
Description | Change the API's status. |
URI | http://localhost:9763/publisher/site/blocks/life-cycles/ajax/life-cycles .jag |
URI Parameters | action=updateStatus&name=xxx&version=1.0.0&provider=apiCreateName&status=PUBLISHED&publishToGateway=true&requireResubscription=true |
HTTP Methods | POST |
Example | curl -X POST -b cookies 'http://localhost:9763/publisher/site/blocks/life-cycles/ajax/life-cycles.jag' -d 'action=updateStatus&name=PhoneVerification&version=1.0.0&provider=admin&status=PUBLISHED&publishToGateway=true&requireResubscription=true' |
Add/Update an API Document
Description | Add a new API document. |
URI | http://localhost:9763/publisher/site/blocks/documentation/ajax/docs.jag |
URI Parameters | Add Document: action=addDocumentation&provider=xxx&apiName=xxx&version=xxx&docName=xxx&docType=xxx&sourceType=xxx&docUrl=xxx&summary=xxx&docLocation=xxx&docVisibility=owner_only/private Note that docVisibility is applicable only if you have enabled it. See API documentation visibility. Update Document: action=addDocumentation&mode=Update&provider=xxx&apiName=xxx&version=xxx&docName=xxx&docType=xxx&sourceType=xxx&docUrl=xxx&summary=xxx&docLocation=xxx |
HTTP Methods | POST |
Example | Add Document: curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/documentation/ajax/docs.jag -d "action=addDocumentation&provider=admin&apiName=PhoneVerification&version=1.0.0&docName=testDoc&docType=how to&sourceType=inline&docUrl=&summary=testing&docLocation=" Update Document: curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/documentation/ajax/docs.jag -d "action=addDocumentation&mode=Update&provider=admin&apiName=PhoneVerification&version=1.0.0&docName=testDoc&docType=how to&sourceType=inline&docUrl=&summary=new summary&docLocation=" |
Remove an API Document
Description | Remove an API document. |
URI | http://localhost:9763/publisher/site/blocks/documentation/ajax/docs.jag |
URI Parameters | action=removeDocumentation&provider=xxx&apiName=xxx&version=xxx&docName=xxx&docType=xxx |
HTTP Methods | POST |
Example | curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/documentation/ajax/docs.jag -d 'action=removeDocumentation&provider=admin&apiName=PhoneVerification&version=1.0.0&docName=testDoc&docType=How To' |
Get all Throttling Tiers
Description | Get the throttling tiers that can be applied to APIs |
URI | http://localhost:9763 /publisher/site/blocks/item-add/ajax/add.jag? |
URI Parameters | action=getTiers |
HTTP Methods | GET |
Example | curl -b cookies http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag?action=getTiers |
Check if API Exists
Description | Check if an API by a given name exists in the API Publisher |
URI | http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag |
URI Parameters | action=isAPINameExist&apiName=<name of the API> |
HTTP Methods | GET |
Example | curl -b cookies "http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag?action=isAPINameExist&apiName=PhoneVerification" |
Validate Roles
Description | Verifies whether the listed roles are valid in the tenant domain of the current user. |
URI | http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag |
URI Parameters | action=validateRoles&roles=<list of roles> |
HTTP Methods | GET |
Example | curl -b cookies "http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag?action=validateRoles&roles=admin" |