No results for ""
EXPAND ALL
  • Home
  • API docs

Adding a custom approvals integration configuration

Read time: 3 minutes
Last edited: Oct 14, 2024

Overview

This topic describes how to add a custom approvals integration within LaunchDarkly. This is the second step required when building a custom approvals integration. Only customers with complex workflow management or approval systems in third-party applications that LaunchDarkly does not integrate with directly are likely to need a custom approvals integration.

Add the custom approvals integration

After you create your own approval application, you must set up an integration configuration to connect LaunchDarkly and your approval application.

To configure your custom approvals integration in LaunchDarkly:

  1. In the LaunchDarkly UI, navigate to the Integrations page.
  2. Search for the "Custom approvals" integration.
  3. Click Add integration. A "Create configuration" panel appears.
  4. Set the Status of the integration to On.
  5. (Optional) Enter a Name for the integration. This is the name that will appear when you update your LaunchDarkly environment approval settings to use your custom approvals integration.
  6. Enter the API Token that LaunchDarkly should use to authenticate when sending requests to your approval application.
  7. Enter the Custom approval service base URL of your custom approval service. This is where LaunchDarkly will send requests.
  8. (Optional) Enter the Additional form variables. This is a JSON schema describing the information that a LaunchDarkly account member needs to enter when they create an approval request.
Expand for JSON schema details

Here is an example of the additional form variables JSON schema:

[
{
// required
// how your custom approvals application references this field
// LaunchDarkly uses the value here as a key
// in the "additionalFormVariables" object
// in the creationRequest that LaunchDarkly sends to your application
"key": "exampleKey",
// required
// name of the field displayed in the LaunchDarkly approval request UI
"name": "Example field",
// required
// field type, can be any of 'string', 'boolean', 'uri', 'enum', and 'dynamicEnum'
"type": "string",
// required
// field description displayed in the LaunchDarkly approval request UI
"description": "Example description",
// optional
// placeholder text displayed in the LaunchDarkly approval request UI
"placeholder": "Example description",
// optional
// whether the field is optional
// if not specified, defaults to false
"isOptional": false,
// optional
// value if field left unspecified in the LaunchDarkly approval request UI
"defaultValue": null,
// optional
// array of allowed strings for enum-type fields
"allowedValues": null,
// required if type is set to dynamicEnum
// defines the request for getting dynamic options and the paths to parse them out of the response
"dynamicOptions": {
"endpoint": { // required. hostname must match the baseURL of the integration configuration
"url": "https://your-application-host.com/api/colors",
"method": "GET", // can only be GET
"headers": [
{
"name": "Authorization",
"value": "Bearer {{ apiKey }}" // apiKey will auto-fill with the apiKey defined on the integration configuration
}
]
},
"parser": {
"optionsPath": "/data",
"optionsItems": {
"label": "/name",
"value": "/value"
}
}
}
},
{
// additional fields
}
]
  1. Click Save configuration.