API Calls Via Named Session

Last Updated: 12/03/2015 Introduced in Verision: 2.0

This example demonstrates how to use Named Session in cases when User should never use Decisions Portal but for example need to interact with Flows, Forms, Rules or Reports that live in the Portal.

First, we are going to create a new Account. In the Portal we navigate to System > Security > Accounts Folder and click Create Account button on the Folder Actions Panel.

createAccount

In the resulting window we provide Account with Required Information such as Email and Password. Important: we uncheck Can Use Portal checkbox so this Account will not be able to access Portal even with right credentials. Click Ok to save.

configureAccountInfo

Our new Account shows up in the Accounts Folder.

accountCreated

Then, we navigate to System > Security > Named Sessions and click Add Named Session button from the Folder Actions Panel.

addNamedSession

In the resulting window we provide Named Session with Name and using ForAccountId picker we select Account that we have created in the previous steps. Click Ok to save and continue.

defineNamedSession

Named Session is created in the Folder.

namedSessionAdded

To ensure that our system@mycompany.com account cannot use Portal we Logout and try to Log In using this account’s credentials.

loginSystemAcc

As a result, Decisions redirects us to the Page that informs us that we are restricted from using Portal.

errorPage

Next, we are going to create a Flow with a Form. In the Designer Folder we click Create Flow on the Folder Actions Panel.

createFlow

In the resulting window we Name the Flow and click Create to proceed to the Flow Designer.

nameFlow

In the Flow Designer we add Show Form step from the Favorite Steps category.

addForm

Then, we Name the Form and click Create to proceed.

createForm

Our Form for this example designed as following… When we finished designing our Form we can save and close Form Designer.

formDesign

Next, in the Flow Designer we connect the outcome from the Form Step to the End Step in our Flow. This completes our Flow Design. We can save and close Flow Designer.

flowCompleted

Back in the Designer Folder we need to edit permissions for the Folder. From Folder Actions we click Manage > Manage Permissions.

managePermissions

In the resulting Manage Folder Permissions window we click Add New link to add an Account.

addNewAccPermissions

Then, we pick Account that we created previously in this tutorial and click Ok.

pickAccount

Next, we give this Account CanUse permissions only. Click Ok to save and continue.

pickPermissionsCanUse

Permissions for our Account are granted.

permissionsAdded

Back in the Designer Folder we locate the thumbnail for our Flow and from the Action menu select Run[Advanced] > Integration > View Integration Details.

Note:

1. If you are calling a flow that may go async (assigning a task to someone or running a fire and forget flow) this result will be a flow tracking id instead of your expected result.

2. If you call the flow as a SOAP service you will ALWAYS get flow tracking id which is different behavior than REST.

viewIntegrationDetails

On the Integration Page we Generate UI Code to run our Flow as UI/Form using our Named Session that we created in this tutorial as Credentials.

generateUrl

Then, we copy generated UI Code.

urlGenerated

Next, we Logging out of the Portal to ensure that any User will be able to run our Flow.

logOut

We paste Generated UI code into browser and click Enter.

pastUrlBar

Our Form opens…

formOpens

We can fill it in and submit.

enterName

Additional Resources