Step 2: Define the API Design
Now that your API is created, it’s time to define its structure and functionality.
Start Defining the API Design
-
Enter the API Editor:
- Click on the Edit API button to open the API design interface.
- Click on the Edit API button to open the API design interface.
-
Explore the Design Options:
- On the left-hand side of the UI, you’ll find two key options:
- Add Paths: Define the RESTful URLs that host your API endpoints.
- Add Data Types: Create the resource structures your API will expose.
- On the left-hand side of the UI, you’ll find two key options:
Step 2.1: Add Data Types
Data Types are the RESTful resources your API will handle, representing the data structure and attributes.
-
Add a New Data Type:
- Click on the Add Data Type button.
- Provide a meaningful name for the Data Type (e.g.,
User
,Product
, orOrder
). - Click Save to confirm.
- Click on the Add Data Type button.
-
Data Types in Context:
- Think of Data Types as the foundation of your API. They define the shape of the data being sent or received through your endpoints.
- Think of Data Types as the foundation of your API. They define the shape of the data being sent or received through your endpoints.
At this stage, your Data Type is created and ready for further customization. The next step involves adding properties to your Data Type, which represent the resource’s attributes. Let’s continue!