Run the FAC REST API installation example
With everything in place, you can now issue the command within a Command Prompt to run the example.
This script requires information to create and validate the connection to the correct app on the FAC. You must enter the
dmpManager,
clientId,
secret, and
server values into the
dmp-rest-client-example javascript. You can obtain these values by performing the following steps:
- Log in to DMP on the FICO Analytic Cloud(FAC). Navigate to the SOLUTIONS tab.
- The address bar at the top of the browser includes the manager value. Copy this URL, up to and including the first single forward slash, to the dmpManager field in the script.
For example, an address like 'https://manager.yourServerRootDetails.ficoanalyticcloud.com/com.fico.fusion/#Solutions' would be entered as 'https://manager.yourServerRootDetails.ficoanalyticcloud.com/'.
- Click Client Apps. The Client ID and Secret values are displayed in the Application pane—Use the COPY button to the right of each field to copy each value individually to the script.
- Click Components then select the Xpress Insight component you wish to access. In the drop down menu, select Configure.
- In the Component Configuration dialog, click Launch Xpress Insight.
- The address bar at the top of the browser displays the server value, including the branch to the insight app(/insight/). Remove the insight branch and trailing slash from the end of the server address to obtain the correct value.
For example, an address like 'https://yourServerRootDetails.ficoanalyticcloud.com/insight/' would be entered as 'https://yourServerRootDetails.ficoanalyticcloud.com'.
Running the Javascript
![]() |
Note The script accesses the app using the permissions granted to a user named
solutionclient. This user is created the first time the FAC REST API is called. After the user has been created, an Administrator must grant access to the applications it will access.
|
Logged in Getting current user info... Current user solutionclient Getting all apps... Failed request undefined undefined Error: Campaign Conversion not found - aborting
In the Command Prompt window, type node dmp-rest-client-example.js and press Enter.
The scenario is loaded, executed, and closed. The output displayed in the Command Prompt window will resemble the following:
token: NzQ5MTc3OTctZWU3My00NmFhLTkyZjctNTNjNmU2ODZkMjM3 Logged in Getting current user info... Current user solutionclient Getting all apps... Creating scenario... Created scenario [ 'a72fe552-36f0-47b0-bb51-b56667af8b5c', 'Auto scenario 1538400027213', 'Campaign Conversion' ] Setting NC parameter to 1500... Requesting scenario execution... Executing... Job completed Execution completed Getting scenario to verify it completed successfully... Scenario executed successfully OK Setting Budget to 1200... Requesting scenario execution... Executing... Job completed Execution completed Fetching profit... Scenario executed successfully OK Profit is 435521.5842564791 Logging out... Logged out