This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

Expand a topic to see the relevant APIs:

 Common APIs

Note: Before you add or delete users from your tenant, you must first log in to your tenant space in the Cloud as admin.

Login

DescriptionLog in to WSO2 Cloud's tenant space as admin.
URI

https://cloudmgt.cloud.wso2.com/cloudmgt/site/blocks/user/authenticate/ajax/login.jag

URI Parameters
  • action: login
  • userName: Admin's username

  • password: Password of the admin

     
HTTP MethodsPOST
Example

curl  -c cookies -k -v -X POST https://cloudmgt.cloud.wso2.com/cloudmgt/site/blocks/user/authenticate/ajax/login.jag -d 'action=login&userName=myemail@wso2.com &password=adminpassword'

addUserToTenant

DescriptionCreate a new user in the Cloud
URIhttps://cloudmgt.cloud.wso2.com/cloudmgt/site/blocks/tenant/users/add/ajax/add.jag
URI Parameters
  • action: addUserToTenant
     
  • userEmail: Email address of the user
  • password: User's password should meet at least three of the below criteria:
    • Uppercase letters
    • Lowercase letters
    • Numbers
    • Special characters
  • firstName: User's first name (alphanumeric characters      only)
  • lastName: User's last name (alphanumeric characters only)
  • roles: User's roles. Can take one or more of the following roles in a comma-separated list: appclouduser, subscriber, publisher, admin     
HTTP MethodsPOST
Example

curl -k -v -X POST https://cloudmgt.cloud.wso2.com/cloudmgt/site/blocks/tenant/users/add/ajax/add.jag -b cookies -H 'Content­Type:application/x­www­form­urlencoded' -H 'Accept­Language:en­US,en;q=0.5' -­d 'action=addUserToTenant&userEmail=myemail@wso2.com&password=testPassword&firstName=testFirstName&lastName=testLastName&roles=subscriber'

deleteUserFromTenant

DescriptionDelete an existing user from your tenant
URI

https://cloudmgt.cloud.wso2.com/cloudmgt/site/blocks/tenant/users/add/ajax/add.jag

URI Parameters
  • action: deleteUserFromTenant
  • userName: Email address of the user
HTTP MethodsPOST
Example

curl -­b cookies -­k -v -X POST https://cloudmgt.cloud.wso2.com/cloudmgt/site/blocks/tenant/users/add/ajax/add.jag -­H 'Content­Type:application/x­www­form­urlencoded' -H 'Accept­Language:en­US,en;q=0.5'  -d 'action=deleteUserFromTenant&userName=myemail@wso2.com'


 Publisher APIs

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 Publisher web application.
URI

https://api.cloud.wso2.com/publisher/site/blocks/user/login/ajax/login.jag

URI Parametersaction=login&username=xxx&password=xxx
HTTP MethodsPOST
Example

curl -X POST -c cookies https://api.cloud.wso2.com/publisher/site/blocks/user/login/ajax/login.jag -d 'action=login&username=<user name>&password=xxx'

The <user name> should be email@organization_key with @ in the e-mail replaced by dot. For example, if the e-mail is jhon@gamil.com, the <user name> should be jhon.gmail.com@organization_key. You can find the organization_key on the Manage page of the cloud.

Logout

DescriptionLog out from API Publisher web application.
URIhttps://api.cloud.wso2.com/publisher/site/blocks/user/login/ajax/login.jag
URI Parameters?action=logout
HTTP MethodsGET
Examplecurl -b cookies https://api.cloud.wso2.com/publisher/site/blocks/user/login/ajax/login.jag?action=logout

Add API

DescriptionAdd a new API.
URIhttps://api.cloud.wso2.com/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 *.

Parameter nameSyntax
Action*action=addAPI
Name*name=xxx
Context*context=/xxx
Version*version=x.x.x
API visibility

visibility=<public|private|restricted>

The default is public. If you select restricted, mention to which roles as follows: visibility=restricted&roles=role1,role2,role3.

You can read more about API visibility from here.

Thumbnail image
  • To add a thumbnail image as a file object, create the object and pass it with the apiThumb parameter. See sample in this getMultipartEntity() method.
  • To add a thumbnail image as a URL of the image, pass the URL with the thumbUrl parameter as thumbUrl=<URL of the image> 
Descriptiondescription=xxx
Tagstags=x,y,z
Resources*

resourceCount=0&resourceMethod-0=GET&resourceMethodAuthType-0=Application&resourceMethodThrottlingTier-0=Unlimited

  • resourceMethod  can take any one of the following values: GET, POST, DELETE, PUT, OPTIONS
  • resourceMethodAuthType  can take any one of the following values: Application, Application User, Application and Application User, None
  • resourceMethodThrottlingTier can take any one of the following default values: Unlimited, Gold, Silver, Bronze. You can change the default values or have additional tiers defined in the /_system/governance/apimgt/applicationdata/tiers.xml registry location.
Resources as Swagger

Instead of adding resources directly as above, you can add resources, including scopes, as a Swagger payload. Here's an example of adding an API with its Swagger definition:

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", "x-wso2-security" : {"apim" : {"x-wso2-scopes" : [{"description" : "", "name" : "read_number", "roles" : "admin", "key" : "read_number"}]}}, "info" : {"title" : "PhoneVerification", "version" : "1.0.0"}}

In the above code, note that you have one resource path defined with the URL pattern /CheckPhoneNumber under the paths object. This is followed by the HTTP methods of the resource (e.g., GET, POST, PUT etc.) You can have multiple similar resource paths to a single API and multiple HTTP methods to each resource path. For each HTTP method, you can define several parameters.

For more information of the Swagger objects used in this example, see the Swagger 2.0 specification. Described below are the WSO2-specific ones.

  • x-wso2-scopes: The list of scope elements that you want to define. Each element has the below fields. See OAuth Scopes.
    • description: Scope description
    • roles: Allowed roles
    • name: Scope Name
    • key: Scope Key
  • x-auth-type: Authentication type of the method.
  • x-throttling-tier: Throttling tier of the method.
  • x-scope: OAuth scope of the method. This must be one of the list of element you define in x-wso2-scopes.

The following image shows the WSO2-specific parameters we describe here. Also see Resources under Key Concepts for more information.

Endpoints*

This example adds an HTTP production endpoint: endpoint_config={"production_endpoints":{"url":"<URL>","config": {"format":"leave-as- is","optimize":"leave-as-is"," actionSelect":"fault"," actionDuration":60000} },"endpoint_type":"http"}

To give advanced endpoint configurations, add the JSON implementation inside "config:{}." If you don't have any advanced configurations, set it to null as "config":null.

You add sandbox endpoints in the same way. The only difference is that instead of production_endpoints, you give sandbox_endpoints.

If you want to add other types of endpoints, follow the examples below. Note that the endpoint_type of both HTTP and HTTPS endpoints should be HTTP.

  • For address endpoints:
    endpoint_config={"production_ endpoints":{"url":" https://service.endpoint.com ","config" :null},"endpoint_type":" address"}
  • For failover endpoints:
    endpoint_config={"production_ endpoints":{"url":" https://service.endpoint.com ","config" :null}, "production_failovers":{"url" :" https://failover1.endpoint.com ","config":null}, {"url":" https://failover2.endpoint.com ","config":null}], "sandbox_failovers":[]," endpoint_type":"failover"}
  • For load balanced endpoints:
    endpoint_config" {"production_endpoints":[{" url":" https://service.endpoint1.com ","config":null}, {"url":" https://service.endpoint2.com ","config":null}] , "algoCombo":"org.apache. synapse.endpoints.algorithms. RoundRobin","failOver":"True", "algoClassName":"org.apache. synapse.endpoints.algorithms. RoundRobin", "sessionManagement":" simpleClientSession"," sessionTimeOut":30,"endpoint_ type":"load_balance"}
Endpoint security scheme

endpointType=<secured|nonsecured>

The default is non-secured but if you select 'secured', you must pass the credentials as follows: endpointType=secured&endpointAuthType=<basicAuth|digestAuth>&epUsername=<your username>& epPassword=<the password>

Make default version

To mark this version of the API as the default version from a group of versions, give default_version_checked=default_version .

The Default Version option means that you make this version the default in a group of different versions of the API. A default API can be invoked without specifying the version number in the URL. For example, if you mark https://host:port/youtube/2.0 as the default version when the API has 1.0 and 3.0 versions as well, requests made to https://host:port/youtube/ get automatically routed to version 2.0. 

If you mark any version of an API as the default, you get two API URLs in its Overview page in the API Store. One URL is with the version and the other is without. You can invoke a default version using both URLs.

If you mark an unpublished API as the default, the previous default, published API will still be used as the default until the new default API is published (or prototyped).

Tier Availability*tiersCollection=<Gold,Silver,Bronze,Unlimited>
Transports

http_checked=http&https_checked=https

Both are selected by default. If you want to set only the HTTP transport, leave the https_checked parameter empty as http_checked=http&https_checked=&.

Sequences

If you want to engage a custom sequence to the API, give inSequence=<sequence name>&outSequence=<sequence name>. This tutorial explains how to create sequences and add them to the registry.

Response caching

responseCache=<enabled|disabled>

 It is disabled by default but if you enable it, pass the response cache timeout as follows: responseCache=enabled& cacheTimeout=300

See Response Caching for more information.

Subscriptions

By default, subscription is allowed to the current tenant only.

Add the argument subscriptions=all_tenants to enable subscriptions to this API by all tenants. To enable subscription to selected tenants, use subscriptions=specific_tennats&tenants=<tenant name>. For example, &subscriptions=all_tenants.

See API visibility and subscription for more information.

Business information

Add a section like this: bizOwner=<name>&bizOwnerMail=<e-mail address>&techOwner=<name>&techOwnerMail=<e-mail address>

HTTP MethodsPOST
Example

curl -X POST -b cookies https://api.cloud.wso2.com/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&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":" https://ws.cdyne.com/phoneverify/phoneverify.asmx","config":null},"endpoint_type":"http "}';

Update API

DescriptionUpdate an existing API
URIhttps://api.cloud.wso2.com/publisher/site/blocks/item-add/ajax/add.jag
URI Parameters

Parameters are same as in Add API except that a ction= updateAPI and you can only update the following parameters: visibility, thumbUrl, description, tags, endpointType, endpoint_config (can change the endpoint URL etc,) http_checked, https_checked, tiersCollection, swagger and can also add new resources. See example below.

HTTP MethodsPOST
Example

Update API : curl -X POST -b cookies https://api.cloud.wso2.com/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&tags=youtube,gdata,multimedia&tier=Silver&thumbUrl= https://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":"https://gdata.youtube.com/feeds/api/standardfeeds","config":null},"endpoint_type":"http"}';

Get All APIs

Get an API

DescriptionGet details of a specific API.
URIhttps://api.cloud.wso2.com/publisher/site/blocks/listing/ajax/item-list.jag
URI Parametersaction=getAPI&name=xxx&version=xxx&provider=xxx
HTTP MethodsPOST
Example

curl -X POST -b cookies https://api.cloud.wso2.com/publisher/site/blocks/listing/ajax/item-list.jag -d 'action=getAPI&name=API1&version=1.0.0&provider=user1'

Remove an API

DescriptionRemove an API.
URIhttps://api.cloud.wso2.com/publisher/site/blocks/item-add/ajax/remove.jag
URI Parametersaction=removeAPI&name=xxx&version=xxx&provider=xxx
HTTP MethodsPOST
Example

curl -X POST -b cookies https://api.cloud.wso2.com/publisher/site/blocks/item-add/ajax/remove.jag -d 'action=removeAPI&name=API1&version=1.0.0&provider=user1'

Copy an API

DescriptionCopy an API to a newer version.
URIhttps://api.cloud.wso2.com/publisher/site/blocks/overview/ajax/overview.jag
URI Parameters

action=createNewAPI&provider=xxx&apiName=xxx&version=xxx&newVersion=xxx

HTTP MethodsPOST
Example

curl -X POST -b cookies https://api.cloud.wso2.com/publisher/site/blocks/overview/ajax/overview.jag -d "action=createNewAPI&provider=user1&apiName=API1&version=1.0.0&newVersion=2.0.0&isDefaultVersion=default_version"

Check Older Version 

DescriptionDoes older version of API exist.
URI https://api.cloud.wso2.com/publisher/site/blocks/life-cycles/ajax/life-cycles.jag
URI Parameters

action=isAPIOlderVersionExist&provider=xxx&name=xxx&version=xxx

HTTP MethodsPOST
Example

curl -X POST -b cookies  https://api.cloud.wso2.com/publisher/site/blocks/life-cycles/ajax/life-cycles.jag ?action=isAPIOlderVersionExist&provider=user1&name=API1&version=1.0.0

Change API Status

DescriptionChange the API's status.
URI https://api.cloud.wso2.com/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 MethodsPOST
Example

curl -X POST -b cookies https://api.cloud.wso2.com/publisher/site/blocks/life-cycles/ajax/life-cycles.jag -d 'action=updateStatus&name=TwitterAPI&version=1.0.0&provider=provider&status=PUBLISHED&publishToGateway=true&requireResubscrip

Add/Update an API Document

DescriptionAdd a new API document.
URIhttps://api.cloud.wso2.com/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 

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

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 MethodsPOST
Example

Add Document: curl -X POST -b cookies https://api.cloud.wso2.com/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="

Add Document file: curl -X POST -b cookies https://api.cloud.wso2.com/publisher/site/blocks/documentation/ajax/docs.jag -F "action=addDocumentation" -F "provider=admin" -F "apiName=testAPi" -F "version=1.0.0" -F "docName=testDoc2" -F "docType=how to" -F "sourceType=file" -F "docUrl=" -F "summary=testing" -F "docLocation=@test.txt"

Update Document: curl -X POST -b cookies https://api.cloud.wso2.com/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

DescriptionRemove an API document.
URI https://api.cloud.wso2.com/publisher/site/blocks/documentation/ajax/docs.jag 
URI Parameters

action=removeDocumentation&provider=xxx&apiName=xxx&version=xxx&docName=xxx&docType=xxx

HTTP MethodsPOST
Example

curl -X POST -b cookies https://api.cloud.wso2.com/publisher/site/blocks/documentation/ajax/docs.jag -d 'action=removeDocumentation&provider=admin&apiName=API1&version=1.0.0&docName=doc1&docType=How To'

Get all Throttling Tiers

DescriptionGet the throttling tiers that can be applied to APIs
URI

 https://api.cloud.wso2.com/publisher/site/blocks/item-add/ajax/add.jag?

URI Parameters

action=getTiers

HTTP MethodsGET
Example

curl -b cookies  https://api.cloud.wso2.com/publisher/site/blocks/item-add/ajax/add.jag?action=getTiers

Check if API Exists

DescriptionCheck if an API by a given name exists in the API Publisher
URI

 https://api.cloud.wso2.com/publisher/site/blocks/item-add/ajax/add.jag

URI Parameters

action=isAPINameExist&apiName=<name of the API>

HTTP MethodsGET
Example

curl -b cookies " https://api.cloud.wso2.com/publisher/site/blocks/item-add/ajax/add.jag?action=isAPINameExist&apiName=PhoneVerification"

Validate Roles 

DescriptionCheck if the user logged in user is any one in a given list of users
URI

 https://api.cloud.wso2.com/publisher/site/blocks/item-add/ajax/add.jag

URI Parameters

action=validateRoles&roles=<list of roles>

HTTP MethodsGET
Example

curl -b cookies " https://api.cloud.wso2.com/publisher/site/blocks/item-add/ajax/add.jag?action=validateRoles&roles=admin"

 Store APIs
Note: When you access any API other than the login and logout, 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 is used in the next API invocation/s.

Login

DescriptionLog in to API Store.
URIhttps://api.cloud.wso2.com/store/site/blocks/user/login/ajax/login.jag
URI Parametersaction=login&username=xxx&password=xxx
HTTP MethodsPOST
Examplecurl -X POST -c cookies https://api.cloud.wso2.com/store/site/blocks/user/login/ajax/login.jag -d 'action=login&username=user1&password=xxx'

Logout

DescriptionLog out from API Store.
URIhttps://api.cloud.wso2.com/store/site/blocks/user/login/ajax/login.jag
URI Parameters?action=logout
HTTP MethodsGET
Examplecurl -b cookies https://api.cloud.wso2.com/store/site/blocks/user/login/ajax/login.jag?action=logout

User Signup

DescriptionAdd a new API Consumer.
URIhttps://api.cloud.wso2.com/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 https://api.cloud.wso2.com/store/site/blocks/user/sign-up/ajax/user-add.jag -d 'action=addUser&username=user2&password=xxx&allFieldsValues=firstname|lastname|email'

Search APIs

DescriptionSearch for APIs using a given query.
URI

https://api.cloud.wso2.com/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 "https://api.cloud.wso2.com/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.
URI https://api.cloud.wso2.com /store/site/blocks/api/listing/ajax/list.jag
URI Parametersaction=getAllPaginatedPublishedAPIs, tenant, start, end
HTTP MethodsGET
Examplecurl -b cookies https://api.cloud.wso2.com/store/site/blocks/api/listing/ajax/list.jag?action=getAllPaginatedPublishedAPIs&tenant=carbon.super&start =0&end=2

Please note that the getAllPublishedAPIs API is 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.
URIhttps://api.cloud.wso2.com/store/site/blocks/subscription/subscription-list/ajax/subscription-list.jag
URI Parametersaction=getSubscriptionByApplication&app=App1
HTTP MethodsGET
Examplecurl -b cookies https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-list/ajax/subscription-list.jag?action=getSubscriptionByApplication&app=App1

Add an Application

DescriptionAdd a new application.
URIhttps://api.cloud.wso2.com/store/site/blocks/application/application-add/ajax/application-add.jag
URI Parametersaction=addApplication&application=xxx&tier=xxx&description=xxx&callbackUrl
HTTP MethodsPOST
Examplecurl -X POST -b cookies https://api.cloud.wso2.com/store/site/blocks/application/application-add/ajax/application-add.jag -d 'action=addApplication&application=app1&tier=Gold&description=&callbackUrl='

Update an Application

DescriptionUpdate an existing application.
URIhttps://api.cloud.wso2.com/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
Examplecurl -X POST -b cookies https://api.cloud.wso2.com/store/site/blocks/application/application-update/ajax/application-update.jag -d 'action=updateApplication&applicationOld=app1&applicationNew=app2&tier=Gold&descriptionNew=&callbackUrlNew'

Get Applications

DescriptionGet list of applications.
URI https://api.cloud.wso2.com/store/site/blocks/application/application-list/ajax/application-list.jag
URI Parameters?action=getApplications
HTTP MethodsGET
Examplecurl -b cookies https://api.cloud.wso2.com/store/site/blocks/application/application-list/ajax/application-list.jag?action=getApplications

Remove an Application

DescriptionRemove an existing application.
URI https://api.cloud.wso2.com/store/site/blocks/application/application-remove/ajax/application-remove.jag
URI Parameters

action=removeApplication&application=xxx

HTTP MethodsPOST
Example curl -X POST -b cookies https://api.cloud.wso2.com/store/site/blocks/application/application-remove/ajax/application-remove.jag -d 'action=removeApplication&application=app2'

Generate an Application Key

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

 https://api.cloud.wso2.com/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>&tokenScope

tokenScope is given in the request when your API has Auth scopes defined. See OAuth scopes.

HTTP MethodsPOST
Examples
  1. curl -X POST -b cookies https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag -d 'action=generateApplicationKey&application=NewApp1&keytype=PRODUCTION&callbackUrl=&authorizedDomains=ALL&validityTime=360000'
  2. curl -X POST -b cookies https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag -d 'action=generateApplicationKey&application=NewApp1&keytype=SANDBOX&callbackUrl=&authorizedDomains=ALL&validityTime=360000&tokenScope=scope1'

Add a Subscription

DescriptionAdd a new API subscription.
URI https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag
URI Parameters

action=addSubscription&name=xxx&version=xxx&provider=xxx&tier=xxx&applicationId=xxx

HTTP MethodsPOST
Examplecurl -X POST -b cookies  https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag -d 'action=addSubscription&name=API1&version=1.0.0&provider=user1&tier=gold&applicationId=1'

List Subscriptions

DescriptionList all API subscriptions.
URIhttps://api.cloud.wso2.com/store/site/blocks/subscription/subscription-list/ajax/subscription-list.jag
URI Parameters

action=getAllSubscriptions

HTTP MethodsGET
Examplecurl -b cookies  https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-list/ajax/subscription-list.jag?action=getAllSubscriptions

List Subscriptions by Application

DescriptionList all API subscriptions of a given application.
URI https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-list/ajax/subscription-list.jag
URI Parameters

action=getSubscriptionByApplication&app=<application_name>

HTTP MethodsGET
Example

curl -b cookies 'https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-list/ajax/subscription-list.jag?action=getSubscriptionByApplication&app=DefaultApplication'

Remove a Subscription

DescriptionRemove an API subscription
URI https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-remove/ajax/subscription-remove.jag
URI Parameters

action=removeSubscription&name=xxx&version=xxx&provider=xxx&applicationId=xxx

HTTP MethodsPOST
Examplecurl -X POST -b cookies https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-remove/ajax/subscription-remove.jag -d 'action=removeSubscription&name=API1&version=1.0.0&provider=user1&applicationId=1'

Delete an OAuth Application

DescriptionDeletes an OAuth application in a third-party Authorization Server. If you delete it through the API Store UI, only the mapping that is maintained in the API Cloud will be deleted.
URIhttps://api.cloud.wso2.com/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag
URI Parameters

action=deleteAuthApplication&consumerKey=<application_key>

HTTP MethodsPOST
Example

curl -k -X POST -b cookies https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag -d 'action=deleteAuthApplication&consumerKey=4lHddsxCtpFa2zJE1EbBpJy_NIQa'

Provision an Out-of-Band OAuth Client 

DescriptionProvisions an OAuth client that was created out-of-band.
URIhttps://api.cloud.wso2.com/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag
URI Parameters

action=mapExistingOauthClient&application=semi&keytype=PRODUCTION/SANDBOX&callbackUrl=<URL>&authorizedDomains=<The domains from which requests are allowed to the APIs>&validityTime=<time duration in seconds>&client_id=<client ID>

HTTP MethodsPOST
Example

curl -X POST -b cookies https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag -d 'action=mapExistingOauthClient&application=semi&keytype=PRODUCTION&callbackUrl=google.com&authorizedDomains=ALL&validityTime=3600&client_id=mPbgvinvpEk1QcSrw962TLICriUa&jsonParams={"username":"admin","key_type":"PRODUCTION","client_secret":"ynEI1ugq1_RCTJ9bM8jtD9RCsdoa","validityPeriod":3600,"client_id":"mPbgvinvpEk1QcSrw962TLICriUa"}'

Clean Partially Created Keys

DescriptionCleans any partially created keys from the API Cloud database, before adding a new subscription. Partially created keys can remain in the API Cloud databases when an OAuth application of a third-party authorization server gets deleted using the API Store UI. It only deletes the mapping that is maintained in the API Cloud side.
URIhttps://api.cloud.wso2.com/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag
URI Parameters

action=cleanUpApplicationRegistration&applicationName=xxx&keyType=PRODUCTION/SANDBOX'

HTTP MethodsPOST
Example

curl -X POST -b cookies https://api.cloud.wso2.com/store/site/blocks/subscription/subscription-add/ajax/subscription-add.jag -d 'action=cleanUpApplicationRegistration&applicationName=DefaultApplication&keyType=PRODUCTION'

Get all Documentation

DescriptionGet all documents create for a given API
URIhttps://api.cloud.wso2.com/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 "https://api.cloud.wso2.com/store/site/blocks/api/listing/ajax/list.jag?action=getAllDocumentationOfApi&name=PhoneVerification&version=1.0.0&provider=admin"

Get the Contents of a File Document

Add an API Comment

DescriptionAdd a comment to an API.
URIhttps://api.cloud.wso2.com/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 https://api.cloud.wso2.com/store/site/blocks/comment/comment-add/ajax/comment-add.jag -d 'action=addComment&name=CalculatorAPI&version=1.0&provider=admin&comment=test comment'

Get all Endpoint URLs

DescriptionGet all the endpoint URLs of the API Gateway environments configured for an API.
URI

https://api.cloud.wso2.com/store/site/blocks/api/api-info/ajax/api-info.jag

URI Parameters

action=getAPIEndpointURLs&name=xxx&version=x.x.x&provider=xxx

HTTP MethodsPOST
Example

curl -X POST -b cookies https://api.cloud.wso2.com/store/site/blocks/api/api-info/ajax/api-info.jag -d 'action=getAPIEndpointURLs&name=CalculatorAPI&version=1.0&provider=admin'

Get all Available Tiers

DescriptionGet all the tiers available in the deployment.
URI

https://api.cloud.wso2.com/store/site/blocks/item-add/ajax/add.jag

URI Parameters

action=getTiers

HTTP MethodsGET
Example

curl -b cookies https://api.cloud.wso2.com/store/site/blocks/item-add/ajax/add.jag?action=getTiers

  • No labels