Creating, Editing and Deleting APIs
Creating an API
To add a new API manually, you must click Create API, the icon on the right bottom corner (+). If you just hover your cursor over it, three other options will come up:
![api home](_images/api_home.png)
You have four ways to create an API, then:
-
CREATE API: allows you to create an API by inserting the data manually.
-
IMPORT API DOCUMENT: allows you to create an API by importing a documentation file in JSON or YAML format. See more about the import and accepted specification versions below.
-
CREATE API GRAPHQL: you can create a GraphQL API by inserting the data manually.
-
CREATE API IDENTITY: you can create an API Identity by inserting the data manually.
After choosing one of the options listed above, the registration screen will be displayed, and the required fields must be filled (with the exception of importing a Swagger file; in this case, the API is created with all required fields, which can be edited later).
|
If there are environments set up in the Environments page, the option Deployable Environments will be displayed. Otherwise, you might add it later, so it’s not a requirement at this point.
The option Access token expires in determines the token expiration period for a specific API. In case the field is left empty, the default time (10 seconds) will be valid.
The Context field is related to the visibility of your API, which will be displayed only to authorised users. These are the options:
-
Organization: the API will be visible to all users on the system;
-
Groups: the API will also be visible to the users who are members of the selected group.
Learn more about the creation of groups with Access Control; -
Only me: the API will be available only to its original author;
-
Add users: the API will be visible to specific users:
![api add user](_images/api_add_user.png)
All users available in the API Manager will be displayed. To alter the permission of a specific user, select the user and choose between Can view or Can edit.
Although the Can edit option grants permission to edit API information, this permission doesn’t go beyond the access rules defined in the configurations of the user’s policies.
To configure the visibility options of your API correctly, users and groups need to be registered. Check the documentation for Access Control to learn more about the creation of users and Access Policies. |
The Private API option, when marked, doesn’t allow the API to be accessible for consumption on the Developer Portal.
When clicking Save and next, the basic data of API will be saved. The next two steps (Resources and Flows) are not mandatory (if you import a Swagger file, though, the resources data will be already filled out for you). For more details, access the sections on Resources and Flows.
The last step to create an API is the Publish screen:
![create api publish](_images/create_api_publish.png)
This screen allows the API to be deployed, provided the Environments option has been selected in the beginning of the API creation. It is also possible to create test templates, which generate a plan and an app to be linked to the API you are creating. This option will enable the immediate use of your API.
All registered APIs are displayed in cards.
![card api](_images/card_api.png)
Editing or deleting an API
To access the API edition and deletion screen, click the card. You will be redirected to the Overview screen, where data can be edited by clicking the Edit button. On the bottom right corner, you can click Delete to remove the API.
Read more information about the Overview screen. |
![editing](_images/editing.png)
![api action overview](_images/api_action_overview.png)
Importing APIs
You can create APIs from importing documentation files that follow the OpenAPI specification. The accepted versions of the specification are: Swagger 2.0 or OpenAPI 3.0.0.
To do this, hover the cursor over the + button in the bottom right corner of the APIs screen and click on the option IMPORT API DOCUMENT. The following modal window will open:
![import openapi](_images/import_openapi.png)
Enter a name and version for the API that will be created and click SELECT FILE to choose a file from your machine to import. Accepted formats are JSON and YAML.
|
Share your suggestions with us!
Click here and then [+ Submit idea]