Making decision requests
About this task
You’ll use Postman requests to simulate an application requesting decisions about payment amounts. To get started, let’s walk through downloading a Postman collection and assigning values to variables used in the requests.
The PingOne platform requires an access token from your application before you can make calls to the API. You’ll use a Postman request to get the access token, then you’ll make decision requests.
Steps
-
Import a copy of the Postman collection:
-
Click the Run in Postman button below.
-
Click the import a copy link.
-
If you use workspaces in Postman, select a workspace and click Import.
-
-
Go to Collections and click PingOne Authorize: Make a Decision Request to open the collection, then click the Variables tab.
-
If you are outside of North America, update the
authUrl
andapiUrl
current values to use the data center closest to your geographic region.Variable Canada Europe Australia Asia Pacific authUrl
https://auth.pingone.ca
https://auth.pingone.eu
https://auth.pingone.com.au
https://auth.pingone.asia
apiUrl
https://api.pingone.ca
https://api.pingone.eu
https://api.pingone.com.au
https://api.pingone.asia
-
In PingOne, go to Applications > Applications.
-
Click your worker application, then click the Configuration tab.
-
Expand the General section, then copy the following values into the corresponding current value on the Variables tab in Postman:
-
Client ID: The Postman variable is
clientID
. -
Client Secret: The Postman variable is
clientSecret
. -
Environment ID: The Postman variable is
envId
.
-
-
Go to Authorization > Decision Endpoints and expand the Test endpoint.
-
Copy the Endpoint ID and paste it into the current value for endpointId in Postman.
-
In Postman, click Save to save the current values you assigned.
Result:
Now you’re ready to send a request to get an access token.
-
In Postman, select the Get Token request and click Send.
Result:
The access token is in the response.
Now you’re ready to make a decision request.
-
Select Make Decision Request and click the Body tab. Set the
Amount
parameter to10990
. -
Click Send.
Result:
The response body shows that the payment is denied according to our policy of denying payments greater than $10,000 USD.
Let’s try a payment that’s less than $10,000 USD.
-
Change the
Amount
value in the request body to990
and click Send.Result:
As you expect, the payment is permitted.
Result
You’ve simulated a couple of payment decision requests so that you have something to examine further.