Adding Request and Response Messages to REST API
REST APIs can produce successful response and errors. CentraSite allows you to capture the default error responses when an exception or error occurs.
For a list of the sample client request and server response messages, see
Sample Requests and Responses.
Note: | Beginning with version 9.8, although CentraSite supports the existing Sample Requests and Responses wizard, we enforce you use the REST Requests and REST Responses wizards to specify additional details about the REST payload. You may use the Sample Requests and Responses wizard if required. |
To add a sample request and response message
2. In the actions bar for the API, click the Edit icon.
3. Select the Resource and Methods profile.
4. In the Add/Modify Method dialog box, expand the Sample Requests and Responses section.
5. Click the Add Request and Response link.
6. In the Add Sample Request and Response dialog box, enter the following information in the fields provided:
In this field... | Do the following... |
Request | Enter the HTTP request message. Important: | As a best practice, we recommend that you use sample messages that could be sent from the client to the server. |
|
Response/Error | Enter the HTTP response/error message. If you want to specify additional response message, use the plus button to create a new input field. If you want to remove an existing response message, use the minus button. Repeat for each response message that you want to remove. |
7. To further update the new sample request or response message, click the Edit icon. Repeat for each message that you want to modify.
8. To specify multiple request and response messages, click the Add Request and Response link to add each new request and response messages.
9. If you need to delete a request and response message, click the Delete icon. Repeat for each request and response message that you want to delete.
10. After you specify the value for all of the required fields, click the Save icon to save the changes.