Postman serves as a versatile tool for handling REST APIs. It helps in building, testing, documenting, and sharing APIs. Below are the main functionalities it provides:
- Creating API Requests: Postman facilitates the generation of API requests over HTTP and HTTPS, supporting various HTTP methods such as GET, POST, PUT, and DELETE. It enables easy configuration of request parameters such as headers and body.
- Request Collections: Users can organize API requests into collections, providing a structured way to manage requests for specific projects or APIs.
- Environment Variables and Scripts: Postman allows the utilization of environment variables for dynamic requests and provides a scripting interface using JavaScript for automating tasks.
- Testing and Automation: Postman allows the creation and execution of test scripts to validate API responses, ensuring accuracy and supporting automated testing.
- Real-Time Collaboration and Sharing: It facilitates real-time sharing of API requests, environment settings, and collections among multiple users, promoting collaborative development.
Postman offers free and paid versions (Pro and Enterprise), with the latter providing enhanced features and collaborative tools. Widely adopted across developers, test engineers, and enterprises, Postman simplifies API development, testing, and management.
MIDAS API with Postman
Installing Postman and understanding its usage in detail involves visiting the official website.
Download Postman | Get Started for Free
Now, guide you through using the CIVIL Open API with Postman:
- Execute CIVIL NX, open a new file, and connect to Server (Apps → Connect).
CIVIL NX
- Execute installed Postman.
Program execute environment
- To use REST API, you need to create a Collection first. (Similar concept of a folder)
Create Collection
- Click a newly created Collection, select the three dots on the right side, and click the Add Request.
Add Request to Collection
- The window to send a REST API Request has been created. Each component performs the following roles:
① Set the HTTP METHOD. (GET, POST, PUT, DELETE)
② Input the URL for the Request.
③ Set the Header and Body.
④ Execute the Request.
⑤ Display the response received from the server.
Request
- Retrieve the "UNIT" information from the newly opened file in CIVIL NX.
① HTTP METHOD
This action is “READ” information, set the HTTP METHOD as a “GET” as follows.
HTTP METHOD
② URL
Check the base URL in the product and copy it. (Apps → API → API Settings)
CIVIL NX - API Settings
Input the copied Base URL in the input window and add the data URL you want to access as follows.
③ Set Header and Body
The header already has auto-generated data and doesn’t require any modifications.
Header
Add the header as follows.
- Key → Input MAPI-Key
- Value → Copy and paste from the product as the above ② figure.
Input MAPI-Key
In the case of the “GET” and “DELETE” methods, Body is not required.
④ All set to fetch the UNIT information. Click “Send.”
⑤ Check the Response window.
The body will display the retrieved JSON data in a readable format. In the top-right corner, you’ll find the HTTP code, response time, and data size shown.
Verify the consistency of the information obtained through the API with the actual product.
- To modify the “UNIT” information in the new file in the CIVIL NX.
HTTP Method → PUT
URL → Ditto
Header → Ditto
Body
For creation (POST) and modification (PUT), you must send the corresponding JSON data along with the Request.
Access the Body tab, choose raw, and select JSON format. (Refer to the image below.)
Modify the Force to KN and temperature to Fahrenheit using JSON data. Copy the following data and paste it into the request body.
{ "Assign": { "1": { "FORCE": "KN", "DIST": "M", "HEAT": "KCAL", "TEMPER": "F" } } }
Click "Send" to verify that the CIVIL NX data has changed.
Easy to Use
Postman's user-friendly interface and ability to handle REST APIs without programming make it one of the quickest ways to interact with APIs.
Invalid JSON Format
Additionally, its features, like syntax validation for JSON format in the Body section and auto-formatting of complex JSON structures, make it convenient to view and send requests.
Beautify JSON Format
Exploring MIDAS Open API through tools like Postman can offer an excellent opportunity to understand its functionalities and capabilities better. It allows for hands-on experience interacting with the API, making comprehending and using its features easier.