SmartObject REST Services
SmartObject REST Services provide RESTful web services (REST) endpoints for SmartObjects on a K2 Server, based on the configuration of the K2 server to expose certain SmartObjects' methods as REST services (see Configuring SmartObject REST and WCF Services
The RESTful services support XML, ATOM and JSON output formats, and you can specify which format you want returned with a query string options appended to the service endpoint.
Service Endpoints
K2 SmartObject Services REST endpoints provide standard URIs (Uniform Resource Identifiers) for interacting with the available SmartObjects data and operations.
You can determine the available URIs for a K2 environment by navigating to the endpoints.xml URL:
{Scheme}{Server}:{Port}{Service Root}/endpoints/endpoints.xml
example, if opening the endpoints.xml URL on the K2 server itself:
https://localhost:8888/SmartObjectServices/endpoints/endpoints.xml
You should see a listing of available endpoints, similar to the screenshot extract below:
For more information on how the URIs are structured and explanation of the query options, please see URIs for REST Services
SmartObject Method Types
Each of the standard SmartObject method types are available as REST endpoints. Please see the topics listed below for more information on how the method types are exposed and called.
Errors and Response Codes
The SmartObjects Services uses the following standard HTTP status codes.
- 200 (OK) – returned if the call was successful
- 400 (Bad Request) – returned if the Request Body was not correctly formatted
- 404 (Not Found) – returned if something requested is no longer available
- 405 (Method Not Allowed) – returned if the method is not allowed for the SmartObject
- 503 (Service Unavailable) – returned if the K2 Server was unreachable
-
500 (Server Error) – returned if any other error occurred