Defining Result States For Provider Application Service

Select the Results States link for the URI method on the Root Resources page.

By default a single Result State will be created indicating a success (with a Status Code of 200). 

This example illustrates the fields and controls on the Result States page. You can find definitions for the fields and controls later on this page.

Result States page

Result State Section

Field or Control

Description

Category

Result category for the Application Service state. Default values are: Success and Failure.

Application States

Application Server State. Used to set the desired state in developers implementation application class.

For example:

 %This.ServiceAPI.ResultState = "Success - Task Complete";

Status

HTTP response code defined for the result state.

Description

Description for the Application Service state.

The HTTP Response Code grid is used to generate the Open API document for a 3rd party. Each unique HTTP Status Code that was defined on the Result State grid will be shown on the HTTP Response Code Grid.  The developer should add a description which will be part of the Open API definition to provide additional information to the 3rd party.

HTTP Response Codes

An HTTP response code must be used to indicate the result of the HTTP request. The usage of these codes must follow the HTTP specification. Specifically, when there is a validation error in the request,  such as mandatory field is not provided, or a field has invalid value, then the error code in 4xx range must be returned.

Selectable Response Codes include:

  • 200 OK: Request successfully executed and the response has content.

  • 201 Created: Resource successfully created. The response contains the created resource and possibly a location header that points to the new resource.

  • 202 Accepted: Request has been accepted for processing but processing has not been completed. This is required for resource that supports asynchronous process.

  • 204 No Content: Request successfully executed and the response doesn't have content.

  • 400 Bad Request: The request could not be understood by the server due to malformed syntax.

  • 401 Unauthorized: request has not been applied because it lacks valid authentication credentials for the target resource.

  • 403 Forbidden: server understood the request but refuses to authorize it. If authentication credentials were provided in the request, the server considers them insufficient to grant access.

  • 404 Not Found: The requested resource was not found.