Adding a Status Code to the RESTful API
In this task, you define individual HTTP response status codes for each method.
To add a HTTP status code
2. In the actions bar for the API, click Edit icon. 3. Navigate to Advanced Information > Resource and Methods profile.
4. In the Add/Modify Method dialog box, expand the HTTP Status Code section.
5. Click the Add Status Code link.
6. In the Add HTTP Status Code dialog box, enter the following information in the fields provided:
In this field... | Do the following... |
Status Code | Choose a HTTP response status code number. Examples HTTP 200 OK HTTP 400 Bad Request HTTP Error 404 Not Found HTTP Error 500 Internal Server Error |
Name | This is a label that you assign as a meaningful name for the status code. For example, you may call a HTTP 400 response as Validation Error, instead of the Bad Request. |
Description | Optional. Enter a comment or descriptive information about the status code. |
The new status code is added to the HTTP method.
7. To further update the new status code, click Edit . Repeat for each code that you want to modify. 8. To specify multiple status codes, click the Add Status Code link to add each new status code.
9. If you need to delete a status code, click Delete . Repeat for each status code that you want to delete. 10. After you specify the value for all of the required fields, click Save to save the updated API.