To Design an API 设计一个API

This procedure covers one way to create a RAML-based API in Anypoint Platform. You can create a modern RAML-based API from an existing SOAP-based API or start with just an idea and design the API from start to finish using RAML. In this procedure, you design the API from start to finish.

这个过程,是创建API的一种方式,通过Anypoint Platform创建基于RAML的API。你可以根据一个既存的基于SOAP的API来创建一个新的基于RAML的API,或者仅仅根据一个创意使用RAML从头至尾设计一个API。

Prerequisites

前提条件

To create an API in Anypoint Platform, you need an account and permissions. If you do not have an account, you can sign up for a free account in the cloud.

为了在Anypoint Platform上创建一个API,你需要一个账号以及相应权限。如果你还没有账号,可以免费申请一个cloud账号。

https://anypoint.mulesoft.com/login/#/signin

申请网址

If you set up your account in the cloud, you have the permissions to create an API. If you’re using an organization’s account, you might not have these permissioons. You need API Creators and/or Organization Administrator access. To determine your access level, after logging into Anypoint Platform, click Access Management.

如果你创建了cloud账号,你会自动获得创建API的许可。如果你创建的是机构账号,可能没有相应的许可。需要API创建者和/或机构管理员工权限。你可以在登入Anypoint Platform后,点击权限管理查看你的权限等级。

In the Access Management screen, click Roles, and look for API Creators or Organization Administrator. If one or both of these roles are visible in the Roles listing, you can proceed. If you cannot see these roles, contact your site administrator before proceeding with this procedure.

在权限管理界面,点击Roles(角色),确认是否是API创建者(API Creators)或者机构管理员(Organization Administrator)。如果角色列表里两者都有或者有其中之一,你就可以继续后面的操作了。如果列表里没有这两个角色,联系你的相应的负责人为你设定相应的角色。

Create an API Definition and Build a RAML File

创建 一个API定义并且创建一个RAML文件

An API definition is the name of an API and its version that you specify in the API Manager.

API定义包含了在API Manger中区分API的API名称以及版本号。

1. After signing in to Anypoint Platform, set up the API.

登入Anypoint Platform后,设置API

2. Design the basic RAML API.

设计基本的RAML API。

3. Simulate calls to the API.

模拟对API的调用

你可能感兴趣的:(To Design an API 设计一个API)