API creation is the process of linking an existing backend API implementation to the API Publisher so that you can manage and monitor the API's lifecycle, documentation, security, community and subscriptions. Alternatively, you can provide the API implementation in-line in the API Publisher itself.
If you have not registered to the API Cloud yet, go to https://cloud.wso2.com/ and sign up. Then, log in to the API Cloud and the API Publisher Web application will open automatically.
Let's create an publish an API. See the video tutorial here or a step-by-step walk-through of the video tutorial below.
Here's a step-by-step walk-though of the video tutorial:
- Log in to the API Publisher.
Click the Add link and provide the information given in the table below.
Field Sample value NamePhoneVerificationContext/phoneverify Version 1.0.0 Visibility Public Resources URL pattern CheckPhoneNumber Request types
GET, POST, OPTIONS
Tip: Selecting the
OPTIONSmethod is mandatory if you want to allow subscribers to invoke the API using the API Console in the store.
For the resources that have methods requiring authentication (i.e., Auth Type is not NONE), you set None as the Auth type of
OPTIONSto support CORS (Cross Origin Resource Sharing) between the API Store and Gateway.
Click Add New Resource. After the resource is added, expand its
GETmethod, add the following parameters to it and click Implement.
You add these parameters as they are required to invoke the API using our integrated API Console in later tutorials.
Parameter Name Description Parameter Type Data Type Required PhoneNumber Give the phone number to be validated Query String True LicenseKey Give the license key as 0 for testing purpose Query String True
Implementtab opens. Provide the information given in the table below. Click the Show More Options link to see the options that are not visible by default.
Field Sample value Implementation method Backend Endpoint type HTTP endpoint Production endpoint
This sample service has two operations as
CheckPhoneNumbers. Let's use
To verify the URL, click the Test button next to it.
Endpoint security scheme Non Secured
(If secured, user is asked for credentials of the backend service)
Click Manage to go to the
Managetab and provide the following information.
Field Sample value Description Tier Availability Select all The API can be available at different levels of service. They allow you to limit the number of successful hits to an API during a given period of time. Transports HTTP and HTTPS The transport protocol on which the API is exposed. Both HTTP and HTTPS transports are selected by default. If you want to limit API availability to only one transport (e.g., HTTPS), un-check the other transport.
- Click Save & Publish. This will publish the API that you just created in the API Store so that subscribers can use it.
You have created an API.