Introduction
If you want to check how the configured API works on the client side, you must test it with Swagger to display your configured schema. This will allow you to download the exposed data in JSON format and provide the URL of the API for other resources to consume it.
Prerequisites
- The Expose Web API file you need must already exist.
- The Client ID and App Secret must be generated for the registered client application (This can be created from the option Tools- Open App Security).
- The DataGet scope must be selected for the registered client application.
|
Quick Steps |
| 1 |
Open the Expose Web API file. |
| 2 |
Open Swagger, then click the Authorize button. |
| 3 |
Enter the authorization details, then select the Scope and click the Authorize button. |
| 4 |
Click the Close button. |
| 5 |
Click the GET button, then click the Try it out button. |
| 6 |
Enter the parameters, then click the Execute button. |
| 7 |
Download the data file, if required. |
Detailed Steps
Step 1. Open the Expose Web API file.
You are going to test the apiGetCustomer file.
Step 2. Open Swagger, then click the Authorize button.
You're going to use Swagger to test the Web API.
Authorization is important to make the application secure and to control who can have access to it.
Step 3. Enter the authorization details, then select the Scope and click the Authorize button.
Here, you need to enter the Client ID and App Secret generated while registering the client application.
Select the desired scope depending on your data operation. In this case, select DataGet as the scope. Click the Authorize button.
Scope determines the end points of the API that the client application can access.
Step 5. Click the GET button, then click the Try it out button.
Swagger opens the Parameters and Responses panels.
The locked icon will appear when you are successfully authorized.
Click the Try it out button. Swagger enables entering the parameters.
Step 6. Enter the parameters, then click the Execute button.
In this case, Customer ID is the default parameters and is required.
This example uses Customer ID and City as parameters. Enter “65” and “Portland” respectively.
When you click Execute, Swagger displays the response. The data from the entity and collection will be sent or exposed to the specified resource with the configured schema.
Step 7. Download the data file, if required.
Swagger generates an API link that can be used in other applications. Click the Download button to download the API response in a JSON file.
You can get the response in the downloaded file.
What are the improvements over S3 Version 6?
This is a new process.
Related Articles
Create an Expose Get Web API File
Edit the Expose Get Web API File Details
This post is part of the Web API topic. Click here to open Web API Overview
#Develop
#Development Studio
#Task Steps
#Everyone
#Text Help
#Xelence
#API
#WebAPI