Usecase
...
Enable the internal use of APIs
...
Help pick and choose subset of those to be used with partners
...
This sample scenario elaborates as to how you can manage public vs. partner vs. private APIs with WSO2 API Manager.
Table of Contents | ||||
---|---|---|---|---|
|
Use case
The following are the use cases with regard to managing public vs. partner vs. private APIs.
Ability to use some of the APIs internally.
Ability to share a subset of the internal APIs with partners.
As a result of the latter mentioned use case, it should facilitate the development of an API ecosystems with partners across industries (e.g., ability to book a hotel and a car when you book as well at the time of booking a flight).
Connect with APIs
from partnersthat are owned by your partner
Enable partners to connect with
oursyour APIs
Expose some of the APIs as public APIs to expand the business operations.
Maintain a further subset of the APIs so that it can be exposed as public APIs. Many of the same APIs that are used internally and with partners can be used as public APIs in order to drive additional business and help obtain new cusalexers.
...
customers.
Business story
ABC organisation organization is an organisation organization that has separate departments for finance and operations other than their core business department which is mobile phone manufacturing.
The core business department is called , finance, and operations departments are named
department_core
and the finance department is calleddepratment_finance
and operations department is nameddepartment_operations
,department_finance,
anddepartment_operations
respectively.
The finance department handles the salaries of employees. The core department is responsible for maintaining the mobile phone manufacturing stock. The operations department handles maintenance work of the organization.
Description of each API is as follows.:
Employee_info_API
- Used by the core and finance departments.Mobile_stock_API
- An This API is used to get details of the current mobile stock details. Used , and is used by the core department.Salary_details_API
- An This API is used to get the details with regard to the salary of employees. Used the employees, and is used by the finance department.Maintenance_Task_API
- An API used to get maintenance tasks required for the day.
Business use cases
...
The following user cases are related to the above mentioned sample business scenario
...
.
The finance department (
deparment_finance)
needs to get the salary of each and every employee. This data is private to the Finance Departmentfinance department.The core department (
department_core)
needs to know the details about stocks such as the stocks (e.g., the current stock price). This is private to the Core Departmentcore department.Both Finance The finance and Core core departments both need to know the employee details of the employees who are working in Core department. This data is only provided to the Core core and Finance departments, and the Operations finance departments. The operations department should not be able to access this the latter mentioned data.
The core department (
department_core)
and the public needs need to know the current prices of the mobile phones.The operations department (
department_operations
) needs to know the maintenance tasks required for the day.When a public user gets a phone the details with regard to the price of a phone in Brand , which belongs to brand “A” and model “B”, that same user should be able predicted automatically shown the prices of the pouches for the relevant model phone.
Sample Business Use Cases Related to Sample One
API Development - Managing Public, Partner vs Private APIs
The following define how the business story is related to a real world business scenario
Using some of the APIs internally.
Share a subset of those APIs with partners if needed.
This will facilitate to develop an API ecosystems with partners. It will be helpful to maintain partnerships across industries.
- This enables to connect with partners while allowing them to connect with our APIs.
Moreover, some APIs can be exposed as public APIs to expand the business operaions.
How this Business Scenario can be Achieved Using WSO2 API Manager
In API manager we need to create
Three different tenants for the three departments with users that can create APIs
An API visible only to the tenant relevant of finance department to get employee salary details.
An API visible only to the tenant relevant of core department to get current mobile stock details
An API visible only to the tenant relevant of operations department to get required maintenance task for the day.
An API subscription visible only to the finance and core departments but restricted to operations departments, to get the employee details of employees working in the core departments.
An API publicly visible, to get mobile phone prices by exposing a api to mobile phone prices. This API should be tagged as “mobile”. An API to get the prices of the mobile pouches. This should also have the tag “mobile”. In this scenario when an application client calls the mobile phone prices it will call another API to the API’s which has the same tag and get the relevant results. (When a user buys a mobile, matching pouches are predicted to buy.)
Note Depending on the situation, we can specify the "Visibility on Store" as Public (the API is accessible to everyone) or Restricted by roles (the API is visible only to specific user roles in the tenant store that you specify).
Running the sample to populate the sample data
...
phone pouches that correspond to that relevant phone model.
Running the sample
Run the sample as follows to populate the sample data:
Download wso2am-2.2.0-sample-scenarios.
- Unzip and
...
- copy sample-scenarios folder to
...
-
<API-M_HOME>
folder. Start the wso2am-2.
...
2.0
...
distribution.
Go to
<API-M_HOME>/sample-scenarios
...
directory and execute the
run.sh
file.Code Block ./run.sh
Enter the scenario number as 1, when prompted.
User credentials
...
The following are the user credentials that you need to use when signing in to the WSO2 API Manager instance that has the sample data populated.
User | Username | Password |
---|---|---|
Finance department user | chris@financejohn@finance.abc.com | 123123 |
Manufacturing department user | alex@coretom@core.abc.com | 123123 |
Maintenance department user | sam@operationsbob@operations.abc.com | 123123 |
...
Created APIs.
Created Tenants
...
Implementing the scenario using WSO2 API Manager
You need to do the following in WSO2 API Manager.
Create three different tenants for the three departments with users that can create APIs.
The screen shot below illustrates the tenants in the system.
The following screen shot depicts the created APIs.
Create an API that is visible only to the tenant who is part of the finance department, in order to get the employee salary details.
The screen shot below illustrates that John can subscribe to the
Salary_details_API
...
as John belongs to the finance department.
The
...
screen shot below
...
illustrates that John can not subscribe to the
Mobile_stock_API
...
,
because John does not belong to the core manufacturing department.
...
Create an API that is visible only to the tenant who is part of the core department, in order to get the current mobile stock details.
The screen shot below illustrates that Tom can subscribe to theMobile_stock_API
...
as Tom belongs to the core manufacturing department.
...
Create an API that is visible only to the tenant who is part of the operations department, in order to get the maintenance tasks that are required for the day.
Create an API subscription that is visible only to the finance and core departments, but restricted to the operations departments, in order to get the details of employees who are working in the core departments.
The screen shots below illustrates that both John and Tom can subscribe to
Employee_info_API
...
as they have permission to access the
Employee_info_API
API.Create an API that is publicly visible, to get mobile phone prices by exposing the API to the mobile phone prices. This API should be tagged as “mobile”.
Note Depending on the situation, you can specify the "Visibility on the Store" as Public, which means that the API is accessible to everyone, or you can restrict by roles, whereby the API is visible only to specific user roles in the tenant store that you specified).
Create an API to get the prices of the mobile pouches. This should also have the tag “mobile”. In this scenario, when an application client sends a request for the mobile phone prices it will also send a request to another API that has the same tag and get the relevant results. (When a user buys a mobile, it should predict the available matching mobile pouches that are for sale.)
You can invoke and check the API’s giving results after subscribing to the relevant API’s and generating the keys.