Define an API resource response structure
Add a schema and relevant response headers to a REST response to define the response's expected data structure.
Before you begin
At least one REST API resource and at least one schema must already be defined for use in the relevant REST API. You must also define any response headers you want to use. For more information, see Define a REST API response header.
Role required: web_service_admin
Procedure
Navigate to a new REST Response record in one of the following ways.
If you navigate through the scripted REST API record, most fields in the REST Response record are pre-populated.
| Option | Procedure |
|---|---|
| Navigate through a scripted REST API record |
|
| Navigate directly to the REST Response record |
|
In the Http status field, enter the HTTP status that the REST response specifications apply to (for example, 200).
For example, return ABC status by entering 200.
In the Schema field, find or enter the schema that defines the structure and format for the resource's selected HTTP status, version, and method.
Add relevant response headers associated with the API.
- Select the Unlock Response Headers icon
.
2. Find or enter relevant response headers associated with the API.
In the Description field, summarize the expected format of the REST response.
Select Submit.
Result
The schema you used to define the response body structure is included in the exportable OpenAPI specification in the REST API Explorer. For more information about exporting OpenAPI specifications, see Export to OpenAPI specification.
Parent Topic:Create a scripted REST API