Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Publisher APIs provide the following REST resources.

Table of Contents
typeflat

...

DescriptionAdd a new API or update an existing API.
URIhttp://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag
URI Parameters

Add API : ?action=addAPI&name=xxx&version=xxx&description=xxx&endpoint=xxx&wsdl=xxx&tags=xxx&visibility=public&tiersCollection=xxx&context=xxx&resourceCount=0&resourceMethod-0=POST&resourceMethodAuthType-0=Application&uriTemplate-0=/*"

Update API : ?action=updateAPI&name=xxx&version=xxx&description=xxx&endpoint=xxx&wsdl=xxx&tags=xxx&visibility=public&tiersCollection=xxx&context=xxx&resourceCount=0&resourceMethod-0=POST&resourceMethodAuthType-0=Application&uriTemplate-0=/*"

HTTP MethodsPOST
Example

Add API :
curl -X POST -b cookies  http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag -d"action=addAPI&name=API1&version=1.0.0&description=TwitterSearch&endpoint=http://search.twitter.com&wsdl=&tags=twitter,open,social&tier=Silver&context=/twitter&tiersCollection=Gold&resourceCount=0&resourceMethod-0=POST&resourceMethodAuthType-0=Application&uriTemplate-0=/*" -d'endpoint_config={"production_endpoints":{"url":"http://search.twitter.com","config":null},"endpoint_type":"http"}'

Update API :
curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag -d"action=updateAPI&name=API1&version=1.0.0&description=TwitterSearch&endpoint=http://search.twitter.com&wsdl=&tags=twitter,open,social&tier=Silver&context=/twitter&tiersCollection=Gold&resourceCount=0&resourceMethod-0=POST&resourceMethodAuthType-0=Application&uriTemplate-0=/*" -d'endpoint_config={"production_endpoints":{"url":"http://search.twitter.com","config":null},"endpoint_type":"http"}'

Note

From APIM 1.6.0 this service accepts endpoint configuration data as a JSON value. In endpoint config JSON you have to specify "endpoint_type" and "production_endpoints" and/or "sandbox_endpoints". 


Get All APIs

DescriptionLists all the created APIs.
URI  http://localhost:9763/publisher/site/blocks/listing/ajax/item-list.jag
URI Parameters?action=getAllAPIs
HTTP MethodsGET
Examplecurl -b cookies  http://localhost:9763/publisher/site/blocks/listing/ajax/item-list.jag?action=getAllAPIs

...

DescriptionChange the API's status.
URIhttp://localhost:9763/publisher/site/blocks/life-cycles/ajax/life-cycles.jag
URI Parameters

action=updateStatus&name=xxx&version=xxx&provider=xxx&status=xxx&publishToGateway=xxx&deprecateOldVersions=xxx&requireResubscription=xxx

HTTP MethodsPOST
Examplecurl -X POST -b cookies http://localhost:9763/publisher/site/blocks/life-cycles/ajax/life-cycles.jag -d “action=updateStatusname=API1&version=1.0.0&provider=user1&status=PUBLISHED&publishToGateway=true&&deprecateOldVersions=false&requireResubscription=true”

Add/Update an API Document

DescriptionAdd a new API document.
URI http://localhost:9763/publisher/site/blocks/documentation/ajax/docs.jag
URI Parameters

Add Document: action=addDocumentation&mode=xxx&provider=xxx&apiName=xxx&version=xxx&docName=xxx&docType=xxx&sourceType=xxx&docUrl=xxx&summary=xxx&docLocation=xxx

Update Document: action=addDocumentation&mode=xxx&provider=xxx&apiName=xxx&version=xxx&docName=xxx&docType=xxx&sourceType=xxx&docUrl=xxx&summary=xxx&docLocation=xxx

HTTP MethodsPOST
Examplecurl -X POST -b cookies http://localhost:9763/publisher/site/blocks/documentation/ajax/docs.jag -d “action=addDocumentation&mode=’’&provider=user1&apiName=API1&version=1.0.0&docName=doc1&docType=how to&sourceType=inline&docUrl=’’&summary=testing&docLocation=’’

...

DescriptionRemove 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 MethodsPOST
Examplecurl -b cookies http://localhost:9763/publisher/site/blocks/documentation/ajax/docs.jag?action=removeDocumentation&provider=admin&apiName=API1&version=1.0.0&docName=doc1&docType=How To