CentraSite Documentation : Working with REST-based APIs : Modeling a RESTful API : Configuring Sample Request and Response Messages : Adding a Request and Response Message to the REST API
Adding a Request and Response Message to the REST API
In this task, you define sample request and response messages for each method.
To add a sample request and response message
1. Display the details page for the REST API that you want to configure.
2. In the actions bar for the API, click Edit  icon.
3. Navigate to Advanced Information > Resource and Methods profile.
4. In the Add Method dialog box, expand the Sample Requests and Responses section.
5. Click 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 Edit . 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 Delete . 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 Save  to save the updated API.
Copyright © Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback