주 콘텐츠로 건너뛰기
Hints and Tips 생성 편집

Let's start MIDAS Open API with Postman

image-20231018-043014.png

 

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:

  1. 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.
  2. Request Collections: Users can organize API requests into collections, providing a structured way to manage requests for specific projects or APIs.
  3. Environment Variables and Scripts: Postman allows the utilization of environment variables for dynamic requests and provides a scripting interface using JavaScript for automating tasks.
  4. Testing and Automation: Postman allows the creation and execution of test scripts to validate API responses, ensuring accuracy and supporting automated testing.
  5. 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).

image-20231018-054313.png

 CIVIL NX

  • Execute installed Postman.

image-20231018-054657.png

Program execute environment

  • To use REST API, you need to create a Collection first. (Similar concept of a folder)

image-20231018-054825.png

Create Collection

  • Click a newly created Collection, select the three dots on the right side, and click the Add Request.

image-20231018-055124.png

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.

image-20231018-065852.png

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.

image-20231018-065801.png

HTTP METHOD

② URL

Check the base URL in the product and copy it. (Apps → API → API Settings)

image-20231018-072235.png

CIVIL NX - API Settings

Input the copied Base URL in the input window and add the data URL you want to access as follows.

image-20231018-070506.png

 

③ Set Header and Body

The header already has auto-generated data and doesn’t require any modifications.

image-20231018-071007.png

Header

Add the header as follows.

  • Key → Input MAPI-Key
  • Value → Copy and paste from the product as the above ② figure.

image-20231018-072429.png

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.

image-20231018-071821.png

Verify the consistency of the information obtained through the API with the actual product.

image-20231018-072006.png

  • 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.)

image-20231018-073217.png

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"
        }
    }
} 

image-20231018-073540.png

Click "Send" to verify that the CIVIL NX data has changed.

image-20231018-073656.png

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.

image-20231018-075747.png

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.

image-20231018-080023.png

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.

0
컨텐츠가 도움이 되셨나요?