*The numbering in this blog links to the numbering in the official integration guide.
To authenticate and use the REST api’s for the following steps you need to have the application key which is shown inside the admin tool.
Navigate to Settings page - Web Apis – Registered Applications and click register application and create a new item.
Click the name to reveal the application key
Using a tool such as curl or Postman use this key to log in.
For more information about this REST call see:
https://docs.oracle.com/en/cloud/saas/commerce-cloud/cxocc/op-ccadmin-v1-login-post.html
In Postman create a REST POST call with the following settings:
POST |
https://hostname.com/ccadmin/v1/login
|
On the Params tab |
Nothing should be added here
|
On the Authentication tab |
Type Bearer and enter this key from before
|
On the Headers tab add Content-Type |
application/x-www-form-urlencoded |
On the Body tab
|
Select the radio button x-www-form-urlencoded Add key/value: grant_type=client_credentials |
In Postman there is the option to see code view click this to verify it is similar to this
POST /ccadmin/v1/login HTTP/1.1 Host: hostname.com Content-Type: application/x-www-form-urlencoded Authorization: Bearer <INSERT APPLICATION KEY HERE> cache-control: no-cache Postman-Token: ******-bf78-47e1-87aa-******** grant_type=client_credentialsundefined=undefined |
Response will contain access token
Copy this token **
Next do a GET to check the extension server :
GET |
https://hostname.com/ccadmin/v1/extensionServers
|
Authentication tab |
Enter the token from above |
Headers tab |
Content-Type : multipart/form-data |
Body Tab
|
nothing |
Code view in Postman:
GET /ccadmin/v1/extensionServers HTTP/1.1 Host: hostname.com Content-Type: multipart/form-data Authorization: Bearer eyJhb***.....*****Q== cache-control: no-cache Postman-Token: ****-d4a7-4fb1-89b2-**** |
Be aware your access can time out.
Using the stand login token
Download the two zip files
https://hostname.com/occs-admin/sse/customer-account-model/CustomerAccountModel-store.zip
https://hostname.com/occs-admin/sse/customer-account-model/CustomerAccountModel-agent.zip
Unzip both zips and open config.json. Edit to add your hostname of your Integration Cloud Service.
{ "crmAccountQueryProp": "crmContactId", "occContactId": "customerContactId", "crmContactId": "contactId", "integrations" :{ "useHTTPS": false, "hostname": "xxx.xxx.oraclecloud.com", "port": 443, "timeout": 50000, "username_env_var": "CRM_USERNAME", "password_env_var": "CRM_PASSWORD", "QUERY_CONTACTS": "/ic/api/integration/v1/flows/rest/OCC_OEC_GET_PROFILE_SSE/1.0/contacts", "CREATE_CONTACT": "/ic/api/integration/v1/flows/rest/OCC_OEC_CONTACT_CREATE_SSE/1.0/contacts", "QUERY_ACCOUNTS": "/ic/api/integration/v1/flows/rest/OCC_OEC_GET_ACCNT_DETLS_PROF_SSE/1.0/accounts", "CREATE_ACCOUNTS": "/ic/api/integration/v1/flows/rest/OCC_OEC_ACOUNT_CREATE_SSE/1.0/contacts/{currentContactId}/accounts", "UPDATE_ACCOUNT": "/ic/api/integration/v1/flows/rest/OCC_OEC_ACCOUNT_UPDATE_SSE/1.0/contacts/{currentContactId}/accounts/{accountId}" } } |
*Note there is no need to change the CRM_USERNAME and CRM_PASSWORD string, these refer to SSE based environment variables, which need to be the string “CRM_USERNAME” and ”CRM_PASSWORD”.
Zip it up again, verify that the zip structure is the same as it was and no extra folder level has been created in the zip process.
Upload the zip using the following POST /ccadmin/v1/serverExtensions
Here is the Body:
Code view to validate your call:
POST /ccadmin/v1/serverExtensions HTTP/1.1 Host: hostname.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW Authorization: Bearer <TOKEN_HERE> cache-control: no-cache Postman-Token: *****-1326-4295-bbc7-**** Content-Disposition: form-data; name="filename" CustomerAccountModel-store.zip Content-Disposition: form-data; name="uploadType" extensions Content-Disposition: form-data; name="force" true Content-Disposition: form-data; name="fileUpload"; filename="***path to file***\CustomerAccountModel-store.zip ------WebKitFormBoundary7MA4YWxkTrZu0gW-- |
To validate your extension is there, using the standard token. You can click the download button to download the zip and verify your changes are uploaded ok.
Save this as a zip.
https://hostname.com/ccadmin/v1/serverExtensions/CustomerAccountModel-store.zip
and
https://hostname.com/ccadmin/v1/serverExtensions/CustomerAccountModel-agent.zip
Or
To also validate your zips are uploaded you can check the timestamps of the SSE’s:
GET https://hostname.com:443/ccadmin/v1/serverExtensions
Next add SSE environmental variables CRM_USERNAME and CRM_PASSWORD to your SSE:
If you wish to view your SSE environmental variables:
If you wish to refresh your SSE’s on the server you can use:
https://hostname.com/ccadminx/custom/v1/servers/push
You can read more about this here:
https://docs.oracle.com/en/cloud/saas/commerce-cloud/cxocc/op-ccadminx-v1-servers-push-post.html
Through the OCC storefront create a new account, you should see no error messages.
Inside the tracking in Integration cloud you can see that the message was successfully fired.
Once the profile and account is created you will be able to view and update it via both Commerce Cloud and Engagement Cloud.
Above is a screenshot of update on the storefront account page.
Here is a screenshot of the same user in OEC:
If you receive a message like this in the OCC front end or through a REST call:
Verify that the config.json is correct by using postman to make the call.
To view SSE logs to see if anything is reported.
This integration is designed as a low/no code example on how to persist users from Oracle Commerce Cloud to Oracle Engagement Cloud using Oracle Integration Cloud. We have walked through the 3 main areas of the integration with screenshots.
Previous Post
Next Post