Fusion REST API Quick Start
Fusion REST API Quick Start
You can make many types of HTTP requests using Oracle Applications Cloud REST APIs. You can easily make requests to view, create,
Get Started update, or delete records. As an example, let's look at how to send a simple REST HTTP request to Nnd out the structure of an invoices object.
Quick Start
Use Cases
Step 1: Consider Before You Start
Review the basics. If you're new to REST APIs, make sure you understand the basics of REST and JSON, and scan our list of important terms.
Learn More
Review Roles and Privileges. You must have the necessary security roles and privileges to use the GET, POST, PATCH, and DELETE methods on your
Reference
parent and child resources. For more details, see Security Reference for Financials and Security Reference for Common Features.
Change History
Review opt-in requirements. Some REST resources or their aVributes may be associated with features that require opt-in before you can use them.
Tasks You must make sure that you enable opt-in features before you start.
Alternate Name Mapping Rules Choose a REST client. REST APIs connect software programs over the HTTP protocol. You need a software client to send the HTTP requests. In our
examples, we use cURL. But, cURL isn't the only tool you can use. To help you choose one, see Work with your REST Client.
A]ribute Derivation Mapping Sets
A]ribute Derivation Rules Step 2: Get Your Oracle Financials Cloud Account Info
AutoInvoice Interface Lines To make a REST HTTP request, you need to gather a few bits of information:
Bank Account User Rules REST Server URL. Typically, the URL of your Oracle Cloud service. For example, https://servername.fa.us2.oraclecloud.com.
Bank Accounts User name and password. An Oracle Cloud service user with permissions to access the resources you're using.
Bank Branches You can Nnd the REST Server URL, user name, and password in the welcome email sent to your Oracle Cloud service administrator.
Banks
Step 3: ConLgure Your Client
Bill Management Users
With the information gathered so far, you're ready to conNgure your client to send a REST HTTP request.
Brazilian Fiscal Documents
[. Construct the request URL. The URL consists of the server name and the resource path:
Budgetary Control for Enterprise Performance
Management Budget Transactions
https://<server>/<resource-path> Copy
Budgetary Control Results Budget Impacts for The <server> is the REST Server URL from Step 2, as in:
https://servername.fa.us2.oraclecloud.com Copy
The <resource-path> is the relative path or endpoint to the resource you're working with. You can pick any endpoint in All REST Endpoints.
However, some resources or their aVributes may be associated with features that require opt-in before you can use them. Ask your
implementation manager which features are opted in for your company.
In our example, we're interested in the Invoices resource or its aVributes, which requires us to opt in the feature associated with it.
/fscmRestApi/resources/11.13.18.05/invoices Copy
Combine the REST Server URL and, in this example, the Invoices resource path and your request URL is complete. For more information, see
REST API Versions and URL Paths.
https://servername.fa.us2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/invoices Copy
In a client, such as Postman, you enter this combined URL in the Request URL Neld.
Note: If you're using Visual Builder Studio to access REST APIs, see Create a Service Connection from a Service SpeciNcation.
To access REST APIs using Oracle Integration Cloud, see ConNgure the REST Adapter to Consume an External REST API with
No Metadata Described in a Document. You can also build your own client to access REST resources. To build a client using the
Java programming language, see Accessing REST Resources with the JAX-RS Client API.
_. Provide your account information. Include your user name and password (from Step 2) in the client. For example, if you are using cURL, you
can specify your account information using the -u cURL command as follows:
-u <username:password> Copy
In a client such as Postman, you enter the username and password on the Authorization tab. This screenshot shows how to specify this
information in Postman:
You must also select the appropriate authorization type, such as basic, for your server. See Step 4 for details.
d. Set the media type. Media type deNnes the structure of the HTTP payloads exchanged between the server and the client. For example, if
you're using cURL, you can specify a resource item media type using the header -H command as follows:
-H 'Content-Type: application/vnd.oracle.adf.resourcecollection+json' Copy
For any request that has a request body (like POST or PATCH), you must include the Content-Type request header. For more on media types,
see Supported Media Types.
When you're done, the complete cURL command should look like this:
curl -u <username:password> \ Copy
-X GET https://servername.fa.us2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/invoices/describe \
-H 'Content-Type: application/vnd.oracle.adf.resourcecollection+json' | json_pp
If you're not familiar with any of the syntax used in the example, check out Work with your REST Client.
Depending on your business requirements, you might want to set the REST Framework or conNgure Cross-Origin Resource Sharing (CORS) now to
Nne-tune the REST API behavior. Otherwise, you're ready to move on to Step 4.
Step 4: Authenticate and Authorize
Now that you've conNgured the client with a complete request URL, it's time to authenticate and authorize yourself. Authentication proves that your
credentials are genuine, and authorization allows you to apply your access privileges.
Authentication
To make sure data access over a network is secure, Oracle Applications Cloud REST APIs use a global Oracle Web Services Manager (OWSM) security
policy called Multi Token Over SSL RESTful Service Policy (oracle/multi_token_over_ssl_rest_service_policy). This security policy
enforces the following authentication standards:
Basic authentication over SSL (Secure Socket Layer), which extracts the user name and password credentials from the HTTP header.
SAML 2.0 bearer token in the HTTP header over SSL , which extracts a SAML 2.0 bearer assertion (XML security token).
JWT in the HTTP header over SSL, which extracts the user name from the JWT .
You must select one of the standards. Let's look at our example using Basic authentication over SSL. To authenticate, you must submit the user name
and password for your Oracle Cloud account. Typically, the user name and password are encoded in Base64 format, as in:
curl \ Copy
-X GET https://servername.fa.us2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/invoices/describe \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-H 'Content-Type: application/vnd.oracle.adf.resourcecollection+json'
Alternatively, you can use the -u cURL option to pass the user name and password for your Oracle Cloud account, as in this example:
curl -u username:password \ Copy
-X GET https://servername.fa.us2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/invoices/describe \
-H 'Content-Type: application/vnd.oracle.adf.resourcecollection+json'
Your authorization and authentication information gets passed in the Authorization key of the request header. When passing tokens (SAML or JWT)
in Postman, the Authorization key must include Bearer, followed by the token, as shown in this screenshot:
Authorization
Authorization enforces access privileges by service role. Access to an object determines access to a resource. So, make sure that your user has the
proper role.
For additional details, including a list of speciNc roles for accessing a resource, see:
Oracle Financials Cloud Security Reference
Oracle Applications Cloud Security Reference for Common Features
Step 5: Send an HTTP Request
You're almost done. Now that your authentication and authorization are set, you're ready to send a test HTTP request. Continuing with our example,
you want to get all the information about the structure of the invoices object in REST. You can do this using the describe action in cURL:
If your request for information about the Account object is successful, you receive a response with a body similar to the following abbreviated
example. If your request fails, and you're using cURL, review the response comments, adjust your request, and then try again. If you're using other
clients, review the failure Status Codes, and then try again.
{ Copy
"Resources" : {
"invoices" : {
"discrColumnType" : false,
"attributes" : [ {
"name" : "InvoiceId",
"type" : "integer",
"updatable" : false,
"mandatory" : true,
"queryable" : true,
"allowChanges" : "never",
"precision" : 18,
"hasDefaultValueExpression" : true,
"title" : "Invoice ID",
"properties" : {
"fnd:GLOBALLY_UNIQUE" : "true"
}
. . .
}, ],
"collection" : {
"rangeSize" : 25,
"finders" : [ {
"name" : "PrimaryKey",
"attributes" : [ {
"name" : "InvoiceId",
"type" : "integer",
"updatable" : true,
"mandatory" : true,
"queryable" : true,
"allowChanges" : "never",
"precision" : 18,
"hasDefaultValueExpression" : true,
"title" : "Invoice ID",
"properties" : {
"fnd:GLOBALLY_UNIQUE" : "true"
}
} ]
} ],
. . .
},
"item" : {
"links" : [ {
"rel" : "lov",
"href" : "https://servername.fa.us2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/invoices/{id}/lov/BusinessUnitVVO
"name" : "BusinessUnitVVO1",
"kind" : "collection"
}, . . .
{
"rel" : "child",
"href" : "https://servername.fa.us2.oraclecloud.com/resources/11.13.18.05/invoices/{id}/child/attachments",
"name" : "attachments",
"kind" : "collection",
"cardinality" : {
"value" : "1 to *",
"sourceAttributes" : "InvoiceId, AttachmentEntityName",
"destinationAttributes" : "Pk1Value, EntityName"
}
}, . . .
{
"rel" : "self",
"href" : "https://servername.fa.us2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/invoices/{id}",
"name" : "self",
"kind" : "item"
}, {
"rel" : "canonical",
"href" : "https://servername.fa.us2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/invoices/{id}",
"name" : "canonical",
"kind" : "item"
} ],
"actions" : [ {
"name" : "get",
"method" : "GET",
"responseType" : [ "application/vnd.oracle.adf.resourceitem+json", "application/json" ]
}, {
"name" : "update",
"method" : "PATCH",
"requestType" : [ "application/vnd.oracle.adf.resourceitem+json", "application/json" ],
"responseType" : [ "application/vnd.oracle.adf.resourceitem+json", "application/json" ]
}, {
"name" : "delete",
"method" : "DELETE"
} ]
},
"children" : {
"ApDocumentSequenceCategoriesVO1" : {
"discrColumnType" : false,
"attributes" : [ {
"name" : "ApplicationId",
"type" : "integer",
"updatable" : false,
"mandatory" : true,
"queryable" : true,
"allowChanges" : "never"
}, . . . ],
} . . .
},
"links" : [ {
"rel" : "self",
"href" : "https://servername.fa.us2.oraclecloud.com/resources/11.13.18.05/invoices/describe",
"name" : "self",
"kind" : "describe"
}, {
"rel" : "canonical",
"href" : "https://servername.fa.us2.oraclecloud.com/fscmRestApi/resources/11.13.18.05/invoices/describe",
"name" : "canonical",
"kind" : "describe"
} . . .]
}
}
}
In a client such as Postman, the results are formaVed and displayed in the response section. For example, Postman lets you view the output in
multiple formats. This screenshot shows the response in JSON:
Note: When working with a resource that uses both an auto-generated unique identiNer and a user-deNned identiNer to expose an
entity relationship (foreign key), you must use only one of these parameters in the request payload in any of the CRUD actions. If
you include both, the behavior isn't speciNed and may change without notice. To understand this, let's assume that the invoices
resource includes a foreign key to a distributions resource. Suppose, the distributions resource has a unique identiNer InvoiceId
(300100175278468) and an alternative user-deNned identiNer called InvoiceNumber (REST_Invoice). When you create a new
invoice, or update an invoice's reference to a distribution, you must not include both the InvoiceId and the InvoiceNumber
parameters in the request payload.
Learn about common processes in the Use Cases section, such as how to import Nnancials data.
Explore the Learn More section to beVer manage collections, or create and run batch actions.
Join the Oracle Developer Community, where you can share tips and advice with others.
© Oracle About Oracle Contact Us Products A-Z Terms of Use & Privacy Cookie Preferences Ad Choices