Discover and Consume APIs
This walkthrough requires Portal Viewer permissions.
Everything you experience when you browse and search the Developer Portal for APIs depends on what other members of your organization have accomplished previously in the Anypoint Platform. To see any API portals in the Developer Portal, at least one of the following must be true:
- Someone in your organization with API Creator permissions has created an API version, published its API Portal, and made that API Portal Public.
- Someone in your organization with API Creator permissions has created an API version, published its API Portal, and arranged for your account to be granted Portal Viewer permissions for that API version.
If you don’t see any APIs listed in your organization’s Developer Portal, first confirm that you are logged in, then check with your organization administrator to request Portal Viewer permissions for any APIs that you should have access to see.
Browsing and Searching the Developer Portal
Sign in to the Anypoint Platform and either land on or navigate to your Developer Portal:
http://apiplatform.anypoint.mulesoft.com/apiplatform/{yourorgdomain}/#/portals
http://apiplatform.anypoint.mulesoft.com/apiplatform/{yourorgdomain}/#/portals
On the Developer Portal, you can browse APIs in an alphabetical list, or search for a specific API by name, version, or its tags.
Accessing API Documentation
Click on the API name or version number to access the API Portal for the T-Shirt Ordering Service. If you don’t see that particular API, you can try to follow these same steps with another API in your organization. Note however, the content of the API Portal varies.
Click to open the API Console from the left hand navigation, if you see it. The API Console is an automatically generated client based on the API’s RAML definition that allows you to test out calls and see possible responses for this API. The API Console serves as interactive documentation for the API.
If the API Portal doesn’t have an API Console, follow the instructions in the API’s documentation to test out the API.
Requesting Access to an API
If the owner of the API has set up an endpoint for it in the Anypoint Platform, you see a button at the top of the page that reads Request API Access. Click this button to register your application with this API. Registering your application allows the API owner to see key information, including contact information, about who and what is accessing their API version, helping them with needs analysis and lifecycle management. If the API owner has applied certain policies to the API, such as client id enforcement, you’ll need to register your application and then pass your client id and client secret in any calls to that API in order to satisfy the requirements of that governance policy.
Registering Your Application
When you request API access, you are given the option to create a new application or to request access on behalf of an existing application that you created previously. When you create a new application, you provide key information about your application and yourself that helps API owners identify the characteristics and needs of your application so they can make good decisions when approving your for a particular SLA tier, for example. It also gives them the information they need in to contact you (should they need to migrate you to a new version of the API, for example).
When you create an application, you are prompted for a Name, Description, Application URL, and Callback URL. If your organization is signed up to use PingFederate for identity management, you are also prompted to select anOAuth Grant Type. Many of these fields are optional – fill them out if they are relevant for your application.
Click Submit to commit your application details, then click Request Access. If the API owner has not configured any policies restricting access, or has set those policies to auto-approve access requests, you see a message that reads "Your API access request has been approved." If the access request requires manual approval, wait for the API owner to grant your request.
After you have created your application, you can access information about it on the My Applications tab on the Developer Portal. You need to be logged in to see your applications, because this information is available only to you. The My Applications display provides you with the unique client id and client secret for your application, which you may need to pass in your API calls for APIs that are protected with certain policies.
Không có nhận xét nào:
Đăng nhận xét