This activity shows you how to create an external service resource and how to define specific HTTP requests in the requests property of the external service resource. The following workflow illustrates the steps required to create four HTTP requests, ranging from a basic request that uses static values (which are applicable only to one request) to more complex requests that use variables and secrets, which are properties that can be applied to any request defined in the external services resource. It also shows you how to create a request that uses inputs, which are values that are expected to be given at request invocation time.

In this use case, the following operations are supported by the PingOne APIs:

Workflow order of operations

This workflow defines HTTP requests to an external service and shows you how to invoke them. The following API call order creates the external service resource first. Next, it steps through four updates to add the HTTP requests. After each PUT operation to add a request, the next step is a POST to invoke the request.

  1. Make a POST request to /environments/{{envID}}/externalServices to add a new external service resource to the specified environment.

  2. Make a PUT request to /environments/{{envID}}/externalServices/{{externalServiceID}} to update the requests property in the external service resource with a an HTTP request that uses static values. The name of this request is Your_First_Request.

  3. Make a POST request to /environments/{{envID}}/externalServices/{{externalServiceID}}/requests/Your_First_Request to invoke the request.

  4. Make a PUT request to /environments/{{envID}}/externalServices/{{externalServiceID}} to update the requests property in the external service resource to add a second HTTP request. This request defines a variable and uses it in the request. The name of this request is Your_Request_Using_A_Variable.

  5. Make a POST request to /environments/{{envID}}/externalServices/{{externalServiceID}}/requests/Your_Request_Using_A_Variable to invoke the request.

  6. Make a PUT request to /environments/{{envID}}/externalServices/{{externalServiceID}}/secrets to create a secret.

  7. Make a PUT request to /environments/{{envID}}/externalServices/{{externalServiceID}} to update the requests property in the external service resource to add a third HTTP request. This request uses the variable and the secret in the request. The name of this request is Your_Request_Using_A_Secret.

  8. Make a POST request to /environments/{{envID}}/externalServices/{{externalServiceID}}/requests/Your_Request_Using_A_Secret to invoke the request.

  9. Make a PUT request to /environments/{{envID}}/externalServices/{{externalServiceID}} to update the requests property in the external service resource to add a fourth HTTP request. This request uses inputs to assign values at invocation. The name of this request is Your_Request_Using_An_Input.

  10. Make a POST request to /environments/{{envID}}/externalServices/{{externalServiceID}}/requests/Your_Request_Using_An_Input to invoke the request.

Click the Run in Postman button below to download a Postman collection that includes the requests described in this section.

Run in Postman