- Using the Oracle Primavera Cloud Data Service with the REST Adapter
- Create the Connections
2 Create the Connections
Before building this integration, you must create two connections: an Oracle Primavera Cloud Data Service connection and an SFTP connection.
The connection to the Oracle Primavera Cloud Data Service is established through the REST Adapter, and the connection to the SFTP service is established through the FTP Adapter.
Create an Oracle Primavera Cloud Data Service REST Connection
- In the navigation pane, select Design, then Connections.
- Click Create.
- In the Create connection panel, do the following
- Select REST.
- Enter the information that describes this connection:
-
In the Name field, enter Oracle Primavera Cloud Data Service Connection.
The value you enter in the Name field is automatically added to the Identifier field. Any spaces or dashes in the name are automatically replaced with an underscore character in the Identifier field. For example: Oracle_Primavera_Cloud_Data Service_Connection. If you choose to modify the identifier, do not include spaces.
- From the Role list, select Trigger and Invoke.
-
- Click Create.
- On the Configure connection properties page, enter the
connection details:
- In the Properties section, do the
following:
- From the Connection Type list, select REST API Base URL.
- In the Connection URL field,
enter the base URL of your Oracle Primavera Cloud Data Service
REST API.
For example:
https://primavera.oraclecloud.com/data/rest.
- In the Security section, do the following:
- From the Security policy list, select OAuth Custom Two Legged Flow.
- In the Access Token Request field, enter
the OAuth access token generation request for accessing the
API.
X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic <base64 encoded code>" -d 'grant_type=client_credentials' https://primavera.oraclecloud.com/primediscovery/apitoken/request?scope=http://primavera.oraclecloud.com/dataPOST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic <base64 encoded code>" -d 'grant_type=client_credentials'
Note:
Use a base64 converter to generate the authcode. For example, you can use https://base64.guru/converter. Enter the input in your base64 converter in the username.password format. For example: testuser@oracle.com:Primavera@1 - Expand Optional security, and then do the
following:
- In the Refresh Token Request field, enter NA.
- In the access_token field, enter access.[tT]oken.
- In the refresh_token field, enter refresh.[tT]oken.
- In the expiry field, enter expires_in.
- In the token_type field, enter token.?[tT]ype.
- In the access_token_usage field,
enter the following:
-H Authorization: Bearer ${access_token} -H x-prime-tenant: <tenant-id> -H x-prime-identity-app: <tenant-appid> -H x-prime-tenant-code: <tenant-code> -H x-prime-region: <region>
Note:
Update thex-prime-tenant
,x-prime-identity-app
,x-prime-tenant-code
,x-prime-region
values before setting the access_token_usage value.
- In the Properties section, do the
following:
- Click Save. If prompted, click Save again.
- Click
Test to ensure that your
connection is successfully configured. In the resulting
dialog, click Test again.
A message confirms if your test is successful.
Create an SFTP Service REST Connection
- In the navigation pane, select Design, then Connections.
- Click Create.
- In the Create connection panel, do the following:
- Select FTP.
- Enter the information that describes this connection:
-
In the Name field, enter SFTP Connection.
The value you enter in the Name field is automatically added to the Identifier field. Any spaces or dashes in the name are automatically replaced with an underscore character in the Identifier field. For example: SFTP_Connection. If you choose to modify the identifier, do not include spaces.
- From the Role list, select Invoke.
-
- Click Create.
- On the Configure connection properties page, enter the
connection details:
- In the Properties section, do the
following:
- In the FTP Server Host Address field, enter the host address of the FTP/FTPS server.
- In the FTP Server Port field, enter the FTP server port number.
- Expand Optional properties, and then from the SFTP Connection list, select Yes.
- In the Security section, do the following:
- From the Security policy list, select FTP Server Access Policy.
- In the User Name field, enter your user name.
- In the Password field, enter your password.
- In the Properties section, do the
following:
- Click Save. If prompted, click Save again.
- Click
Test to ensure that your
connection is successfully configured. In the resulting
dialog, click Test again.
A message confirms if your test is successful.