Importing API Specifications
You can import the specification of a REST API to API Modeler to explore, update, and test the REST API. Ensure that the REST API specification conforms to Swagger specification version 2.0 and the file format is JSON or YAML.
To import REST API specifications:
- Log on to the TIBCO Cloud™ Integration website.
- On the global navigation bar, click , and select the API Model & Mock capability. You are directed to the All API specs page.
- Use one of the following ways to import your REST API specifications:
- Click > Import from filesystem to import REST API specifications from your computer. In the displayed Open dialog, select the REST API specifications to import.
- Click > Import from URL to import REST API specifications from a URL pointing to a Swagger JSON or YAML file. In the displayed Import from URL dialog, enter a URL and click Import. The URL must begin with
http://
orhttps://
. - Click > Import from Github to import REST API specifications from a Github repository. See Importing from Github for more information.
- Drag one or more REST API specifications from your computer to the All API specs page directly.
The imported API specifications are put in the current group or are in the default group if you are currently in the All API specs page.
Note: You can import an API with a maximum size of 400 KB. - Click the View details link in the displayed status banner or notification message to check the importing details:
- If the API specification is successfully imported:
- If an API specification is duplicated with an existing one, that is, both their names and versions are the same:
- If the API specification is a badly formatted or invalid JSON file:
Importing from Github
To import an API specification from Github:
- Click > Import from Github.
- If this is the first time you imported from GitHub, the GitHub login box is shown. TIBCO Cloud Integration uses the OAuth protocol for integration with GitHub. Enter your user credentials to log into GitHub directly, instead of providing user credentials to TIBCO Cloud Integration.
- Click Login to GitHub. The GitHub login box is shown:
- Enter your GitHub username and password and click Sign in. If you do not have a GitHub account, click Create an account. If you have forgotten your GitHub password, click Forgot password?.
- The first time you sign in to GitHub, GitHub asks you to authorize TIBCO Cloud Integration to access your account. This includes your GitHub account user data, as well as access to the private and public repositories of this account. The account user data is used for integrating with GitHub. Click Authorize application.Note: You could also be asked to authorize TIBCO Cloud Integration to access the organization's data in repositories, if you are a member of any organization on GitHub, and TIBCO Cloud Integration has never been authorized to access this organization. Click the Request Access button next to an organization to send the request to the owner of this organization. Send this request before clicking the Authorize application button.
- All the GitHub repositories that you can access are displayed in the Import from GitHub window.
The left side panel of the window lists of all the repositories in which you have read permissions, including organization repositories. For example, the
CatChasing
repository of thePetChasers
organization is displayed there, which only happens when the access request you sent earlier has been approved by the owner of thePetChasers
organization.Note: TIBCO Cloud Integration only supports import from the master branch of the repositories on GitHub. - Select a GitHub repository, and select a File Name.
You can choose the repository from the left panel. Navigate to the target folder, and import the API specifications from this folder.
- Click Import.
Globalization Support
REST specification JSON files containing non-ASCII characters can also be imported when the files are encoded in UTF-8 encoding. However, for some of the UTF-8 encoded files with BOM bytes added at the beginning, you must remove these BOM bytes using third-party tools before they can be imported into API Modeler.
What to Do Next
After importing the API specification, you can do the following operations by moving the mouse pointer over the API specification:
- Click to preview the API.
- Click Create Mock app to test the API. For more details, see Creating an API Mock App.
- Click Edit to edit the API. For more details, see Modeling an API.
- Click Remove to move the API specification to the trash. For more details, see Removing API Specifications.