Oracle® Cloud Using the REST Adapter
Total Page:16
File Type:pdf, Size:1020Kb
Oracle® Cloud Using the REST Adapter Release 18.3 E66630-19 September 2018 Oracle Cloud Using the REST Adapter, Release 18.3 E66630-19 Copyright © 2015, 2018, Oracle and/or its affiliates. All rights reserved. Primary Author: Mark Kennedy This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency- specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government. This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle. Contents Preface Audience vi Documentation Accessibility vi Related Resources vi Conventions vi 1 Understanding the REST Adapter REST Adapter Capabilities 1-1 About Oracle Integration Cloud Service 1-27 About Oracle Integration Cloud Service Connections 1-28 About Oracle Integration Cloud Service Integrations 1-28 How to Implement Specific REST Adapter Features 1-28 How Do I Build an Integration that Exposes the REST API Using the REST Adapter? 1-29 How Do I Configure the REST Adapter to Consume a REST API Protected with 2-Legged OAuth Token-Based Authentication? 1-31 How Do I Configure the REST Adapter to Consume a REST API Protected with 3-Legged OAuth Token-Based Authentication? 1-36 Security Configurations for Popular OAuth-Protected APIs 1-40 Typical Workflow for Creating and Including an Adapter Connection in an Integration 1-40 2 Creating a REST Adapter Connection Prerequisites for Creating a Connection 2-1 Uploading an SSL Certificate 2-2 Creating a Connection 2-3 Adding a Contact Email 2-4 Configuring Connection Properties 2-4 Configuring Connection Security 2-5 Configuring an Agent Group 2-9 Testing the Connection 2-9 iii Testing a REST Adapter Connection with the HTTP Basic Authentication Security Policy Does Not Validate the Credentials 2-9 Editing a Connection 2-10 Cloning a Connection 2-10 Deleting a Connection 2-11 3 Creating an Integration 4 Adding the REST Adapter Connection to an Integration Configuring REST Adapter Basic Information Properties 4-1 What You Can Do from the REST Adapter Basic Info Page 4-2 What You See on the REST Adapter Basic Info Page 4-2 Configuring REST Adapter Request Parameters Properties 4-4 What You Can Do from the REST Adapter Request Parameters Page 4-5 What You See on the REST Adapter Request Parameters Page 4-5 Configuring REST Adapter Request Properties 4-5 What You Can Do from the REST Adapter Request Page 4-5 What You See on the REST Adapter Request Page 4-6 Configuring REST Adapter Request Header Properties 4-8 What You Can Do from the REST Adapter Request Headers Page 4-8 What You See on the REST Adapter Request Headers Page 4-9 Configuring REST Adapter CORS Configuration Properties 4-9 What You Can Do from the REST Adapter CORS Configuration Page 4-10 What You See on the REST Adapter CORS Configuration Page 4-10 Configuring REST Adapter Response Properties 4-10 What You Can Do from the REST Adapter Response Page 4-10 What You See on the REST Adapter Response Page 4-11 Configuring REST Adapter Response Header Properties 4-13 What You Can Do from the REST Adapter Response Headers Page 4-13 What You See on the REST Adapter Response Headers Page 4-14 Configuring Oracle REST Adapter Invoke Operation Selection Properties 4-14 What You Can Do from the REST Adapter Operation Selection Page 4-15 What You See on the REST Adapter Operation Selection Page 4-15 Reviewing Configuration Values on the Summary Page 4-15 What You Can Do from the Summary Page 4-15 What You See on the Summary Page 4-16 5 Creating Mappings and Lookups in Integrations Entering q as a Standard HTTP Query Parameter with the Query as a Value 5-1 iv JSON to XML Special Character Conversion 5-1 6 Administering Integrations 7 Troubleshooting the REST Adapter Processing Large Sample JSON Files with Special Characters 7-1 Using a Surrogate Namespace in Schemas Without a Namespace 7-2 Troubleshooting SSL Certification Issues 7-3 Defining Fault and Response Pipelines in Basic Map Data Integrations 7-3 Empty Arrays Are Not Supported in Sample JSON Files 7-5 Invoke Endpoint URI Must Match the Base URI + Resource URI in REST Adapter 7-5 Invoking JD Edwards Form Service with the REST Adapter Causes APIInvocationError 7-5 REST Adapter Data is Only Saved When You Click Next 7-6 Converting XML to a JSON Document 7-6 Supported Special Characters in JSON 7-7 content-type is Missing for an Asynchronous Flow 7-7 REST URLs Exceeding 8251 Characters Fail 7-8 v Preface Preface Using the REST Adapter describes how to configure the REST Adapter as a connection in an integration in Oracle Integration Cloud Service. Topics • Audience • Documentation Accessibility • Related Resources • Conventions Audience Using the REST Adapter is intended for developers who want to use the REST Adapter in integrations in Oracle Integration Cloud Service. Documentation Accessibility For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup? ctx=acc&id=docacc. Access to Oracle Support Oracle customers that have purchased support have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/ lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired. Related Resources See these Oracle resources: • Oracle Cloud http://cloud.oracle.com • Using Oracle Integration Cloud Service • Using the Oracle Mapper Conventions The following text conventions are used in this document: vi Preface Convention Meaning boldface Boldface type indicates graphical user interface elements associated with an action, or terms defined in text or the glossary. italic Italic type indicates book titles, emphasis, or placeholder variables for which you supply particular values. monospace Monospace type indicates commands within a paragraph, URLs, code in examples, text that appears on the screen, or text that you enter. vii 1 Understanding the REST Adapter Review the following conceptual topics to learn about the REST Adapter and how to use it as a connection in integrations in Oracle Integration Cloud Service. A typical workflow of adapter and integration tasks is also provided. Topics • REST Adapter Capabilities • About Oracle Integration Cloud Service • About Oracle Integration Cloud Service Connections • About Oracle Integration Cloud Service Integrations • Typical Workflow for Creating and Including an Adapter Connection in an Integration REST Adapter Capabilities The REST Adapter can expose integrations as REST APIs by configuring a REST Adapter connection as a trigger. The REST Adapter can also consume any external REST API by configuring a REST Adapter connection as an invoke. This section identifies the capabilities of the REST Adapter when used as a trigger or invoke connection. Note: The REST Adapter treats all endpoints as they are exposed.