Custom credentials

This example demonstrates how to pass an API key, securely stored in a credential, into a request URL as a query string.

Configure the credential

An API key is stored in the password field of a credential.

Configure the Web API definition

The Custom authentication type is selected in the Common Authentication screen for an API definition. A credential does not need to be selected as it is not being passed in the request header. Instead, Expose to process is selected to create an input parameter that will determine the required credential in a process.

In the URL for the request, enter [Credential.Password] in place of the API key.

This parametrizes the password field of the given credential, allowing the value to be passed. The same syntax can be used to pass other values from a credential:

  • [Credential.Password]
  • [Credential.UserName]
  • [Credential.AdditionalProperties<propertyname>]

Specify the credential in an object or process

The required business object and action are selected in a process action and the parameter set in the API definition is available as an input parameter. The value of the parameter is the name of the required credential in quotation marks.

When the object or process is run, the API key from the credential is used in the request:

GET http://www.postcodeuk.com/address/UK/"Andy Taylor"?api_key=FGRS5-PUUDW-NBC2Q-96UYR-QBDSY