This documentation is for WSO2 API Manager 1.8.0 View documentation for the latest release.
Store APIs - API Manager 1.8.0 - WSO2 Documentation
||
Skip to end of metadata
Go to start of metadata

Store 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

DescriptionLog in to API Store.
URIhttp://localhost:9763/store/site/blocks/user/login/ajax/login.jag
URI Parametersaction=login&username=xxx&password=xxx
HTTP MethodsPOST
Examplecurl -X POST -c cookies http://localhost:9763/store/site/blocks/user/login/ajax/login.jag -d 'action=login&username=admin&password=admin'

Logout

User Signup

DescriptionAdd a new API Consumer.
URIhttp://localhost:9763/store/site/blocks/user/sign-up/ajax/user-add.jag
URI Parametersaction=addUser&username=xxx&password=xxx&allFieldsValues=firstname|lastname|email
HTTP MethodsPOST
Examplecurl -X POST -b cookies http://localhost:9763/store/site/blocks/user/sign-up/ajax/user-add.jag -d “action=addUser&username=user1&password=test123&allFieldsValues=firstname|lastname|email”

Search APIs

DescriptionSearch for APIs using a given query.
URI

http://localhost:9763/store/site/blocks/search/api-search/ajax/search.jag

URI Parameters

action=searchAPIs&query=<query>&start=<number>&end=<number>

The start and end parameters determine the range of APIs you want to retrieve. For example, if start=1 and end=3, the first 3 APIs that appear in the search results will be returned. Note that both 0 and 1 represent the first API in the search results, so start=0 and start=1 both means the same.

HTTP MethodsPOST
Example

curl -X POST -b cookies "http://localhost:9763/store/site/blocks/search/api-search/ajax/search.jag" -d "action=searchAPIs&query=test&start=0&end=3"

Get all Paginated Published APIs

DescriptionGet a list of all published APIs in paginated form so that browsing is easier.
URIhttp://localhost:9763/store/site/blocks/api/listing/ajax/list.jag
URI Parameters

action=getAllPaginatedPublishedAPIs, tenant, start, end

The start and end parameters determine the range of APIs you want to retrieve. For example, if start=1 and end=10, the first 10 APIs that appear in the API Store will be returned. Note that both 0 and 1 represent the first API in the store, so start=0 and start=1 both specify that you want to start with the first API.

HTTP MethodsGET
Example

To get the first 100 APIs in the API Store:

curl -b cookies "http://localhost:9763/store/site/blocks/api/listing/ajax/list.jag?action=getAllPaginatedPublishedAPIs&tenant=carbon.super&start=1&end=100"

Please note that the getAllPublishedAPIs API is now deprecated. You can get the same functionality from getAllPaginatedPublishedAPIs.

Get Published APIs by Application

DescriptionGet a list of published APIs filtered by the subscribed Application. Login API needs be called prior to calling this API.
URIhttp://localhost:9763/store/site/blocks/subscription/subscription-list/ajax/subscription-list.jag
URI Parametersaction=getSubscriptionByApplication&app=App1
HTTP MethodsGET
Examplecurl -b cookies 'http://localhost:9763/store/site/blocks/subscription/subscription-list/ajax/subscription-list.jag?action=getSubscriptionByApplication&app=DefaultApplication'

Add an Application

DescriptionAdd a new application.
URIhttp://localhost:9763/store/site/blocks/application/application-add/ajax/application-add.jag
URI Parametersaction=addApplication&application=xxx&tier=xxx&description=xxx&callbackUrl
HTTP MethodsPOST
Example

curl -X POST -b cookies http://localhost:9763/store/site/blocks/application/application-add/ajax/application-add.jag -d 'action=addApplication&application=NewApp1&tier=Unlimited&description=&callbackUrl='

Update an Application

Description Update an existing application.
URI http://localhost:9763/store/site/blocks/application/application-update/ajax/application-update.jag
URI Parameters

action=updateApplication&applicationOld=xxx&applicationNew=xxx&callbackUrlNew=xxx&descriptionNew=xxx&tier=xxx

HTTP MethodsPOST
Example

curl -X POST -b cookies http://localhost:9763/store/site/blocks/application/application-update/ajax/application-update.jag -d 'action=updateApplication&applicationOld=NewApp1&applicationNew=NewApp2&tier=Unlimited&descriptionNew=&callbackUrlNew'

Get Applications

DescriptionGet list of applications.
URIhttp://localhost:9763/store/site/blocks/application/application-list/ajax/application-list.jag
URI Parameters?action=getApplications
HTTP MethodsGET
Examplecurl -b cookies http://localhost:9763/store/site/blocks/application/application-list/ajax/application-list.jag?action=getApplications

Remove an Application

DescriptionRemove an existing application.
URI   http://localhost:9763/store/site/blocks/application/application-remove/ajax/application-remove.jag
URI Parameters

action=removeApplication&application=xxx

HTTP MethodsPOST
Example

curl -X POST -b cookies http://localhost:9763/store/site/blocks/application/application-remove/ajax/application-remove.jag -d "action=removeApplication&application=NewApp2"

Generate an Application Key

DescriptionGenerate the key and secret values for a new application.
URI

http://localhost:9763/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag

URI Parameters

action=generateApplicationKey&application=<app_name>&keytype=<PRODUCTION|SANDBOX>&callbackUrl=<URL>&authorizedDomains=<The domains from which requests are allowed to the APIs>&validityTime=<time duration in seconds>

HTTP MethodsPOST
Example

curl -X POST -b cookies http://localhost:9763/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag -d 'action=generateApplicationKey&application=NewApp1&keytype=PROD&callbackUrl=&authorizedDomains=ALL&validityTime=360000'

Add a Subscription

DescriptionAdd a new API subscription.
URI http://localhost:9763/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag
URI Parameters
  • By application ID: action=addSubscription&name=xxx&version=xxx&provider=xxx&tier=xxx&applicationId=xxx
  • By application name: action=addAPISubscription&name=xxx&version=xxx&provider=xxx&tier=xxx&applicationName=xxx
HTTP MethodsPOST
Example

List Subscriptions

DescriptionList all API subscriptions.
URIhttp://localhost:9763/store/site/blocks/subscription/subscription-list/ajax/subscription-list.jag
URI Parameters

action=getAllSubscriptions

HTTP MethodsGET
Examplecurl -b cookies http://localhost:9763/store/site/blocks/subscription/subscription-list/ajax/subscription-list.jag?action=getAllSubscriptions

Remove a Subscription

DescriptionRemove an API subscription.
URIhttp://localhost:9763/store/site/blocks/subscription/subscription-remove/ajax/subscription-remove.jag
URI Parameters
  • By application name: action=removeSubscription&name=xxx&version=xxx&provider=xxx&applicationName=xxx
  • By application Id: action=removeSubscription&name=xxx&version=xxx&provider=xxx&applicationId=xxx
HTTP MethodsPOST
Example

Get all Documentation

DescriptionGet all documents create for a given API
URIhttp://localhost:9763/store/site/blocks/api/listing/ajax/list.jag
URI Parameters

action=getAllDocumentationOfApi&name=<API Name>&version=x.x.x&provider=<Name of the API provider>"

HTTP MethodsGET
Example

curl -b cookies "http://localhost:9763/store/site/blocks/api/listing/ajax/list.jag?action=getAllDocumentationOfApi&name=PhoneVerification&version=1.0.0&provider=admin"

Add an API Comment

DescriptionAdd a comment for an API.
URIhttp://localhost:9763/store/site/blocks/comment/comment-add/ajax/comment-add.jag
URI Parameters

action=addComment&name=xxx&version=xxx&provider=xxx&comment=xxx

HTTP MethodsPOST
Example

curl -X POST -b cookies http://ore/site/blocks/comment/comment-add/ajax/comment-add.jag -d 'action=addComment&name=PhoneVerification&version=1.0.0&provider=admin&comment=test comment'

  • No labels