Enterprise Applications need to share data and business logic with other systems or applications. One way to address this issue is through REST Web Service, which is a widely supported standard for packaging remote procedure calls in an XML-based structure.

Oracle ATG Commerce provides REST MVC where REST or “Representational State Transfer” provides a Model View Controller (MVC) architecture and framework.

The REST Web Services exposes data and function resources through the use of Uniform Resource Identifiers (URIs). These resources are used within simple, well-defined operations. REST services uses HTTP requests to point to a resource, where each HTTP request is returned by HTTP response, sharing the status of the operation. The application which receives the request identifies the format of the response, which is JSON or XML. The REST clients may be accessed from any browser, and security can be configured for each call.

Oracle Rest API

Benefits of Oracle Commerce REST MVC API

  • You need to learn only one API
  • REST MVC is Modular, Reusable, Extensible, Secure, Filterable
  • You can invoke multiple components in one “round trip”
  • The mechanism enables you to invoke the existing out-of-the-box components without having to duplicate logic to provide an HTTP-based API

A few components of ATG REST Web service are:

REST Web Services URLs

The URLs for Oracle ATG Commerce platform REST Web Services are the locations to which you send the HTTP requests. These URLs are central to the REST Web Services and you can access different components and functions of the Oracle ATG Commerce platform using the specific URL for each of them.

Oracle Rest API

1. Starting the REST module
2. Configuring the REST Server
3. Security for REST Web Services
4. HTTP Requests
5. Input Values
6. Returned Data
7. Errors and Exceptions
8. Client Software
9. ATG Client Libraries

The REST module can be added at the time of ATG configuration through CIM (Configuration and Installation Manager).

Oracle Rest API

Control Parameters

Include control parameters with HTTP requests to alter the way you wish the Oracle ATG Commerce platform REST Web Services to handle them. For example, if you would like the server to include an identifying string in the response you can use the ATG-REST-User-Input control parameter to specify that identifying string.

You can include control parameters either in the URL for the REST Web Service or in the message body of a POST or PUT request.

URL Parameters

You can include control and functional parameters in the URL for Oracle ATG Commerce platform REST Web Services. Use standard URL query string syntax and URL encoding if needed.

Message Body Parameters

The REST Web Services server can interpret message body parameters in one of the following three markup formats. Make sure you set the correct Content-Type value for the markup that you use.

  • XML
  • JSON
  • URL query string

Returned Data

The Oracle ATG Web Commerce platform REST Web Services server will return the results of the operations you perform in an HTTP response message body. The contents of the returned data depend on the operation you are performing.

Choosing Output Markup

The Oracle ATG Web Commerce platform REST Web Services server can return output data in either JavaScript Object Notation (JSON) or eXtensible Markup Language (XML) format. It will enclose all returned data in a JSON object with the name atgResponse or an atgResponse XML element.

The following example shows JSON output markup.

{“atgResponse”: “240004”}

The following example shows XML output markup.

240004

Configure your Oracle ATG Web Commerce platform REST Web Server to return output data in the format you choose. The default output format of the server is controlled by its /atg/rest/Configuration/defaultOutputCustomizer property.

  • For JSON output, set the property to /atg/rest/output/JSONOutputCustomizer.
  • For XML output, set the property to /atg/rest/output/XMLOutputCustomizer.

The server will return data in its default output format if you do not specify the output format for an individual request

To specify the output format for an individual REST Web Services request, include the atg-rest-output control parameter with that request. Set the value of atg-rest-output to either json or xml.

Write to us at info@synergytop.com for your ATG requirements!