Customer Credentials


Customer credentials here refer to the access a customer of LHP or a similar application requires to authenticate a specific integration (since many of these integrations are being called on behalf of the customer and need to interact with their specific service).

Rather than each application needing to manage credentials on their own, the integration api offers services for credential management in order to make the process much easier

Endpoint

Method URI Headers
POST /api/v1/credentials {"Authorization": "Bearer {access_token}"}

Data Params

{
    "data[credentials]"    : "object of key:value credentials to store",
    "data[integration_key]" : "the integration key these credentials will pertain to",
}

{success} Success Response

Code: 200

Content

{
    "data": {
        "type": "credential",
        "id": "{credential_id}"
    }
}

When created, the credentials passed are encrypted and stored. You will then want to store {credential_id} in your own application locally, tying it to the integration and related user. Going forward when making calls to this integration, you will simply need to pass credential: {credential_id} and the integration api will find that stored credential, decrypt it, and send it to the integration you are interacting with.

Passing raw credentials

If your application already has it's own means of storing customer credentials, or there is no need to store credentials for future use, an action that requires customer credentials can be called by passing credentials through the credentials_raw property.

Example of using raw credentials:

Method URI Headers
POST /api/v1/integrations/example/leads {"Authorization": "Bearer {access_token}"}

Data Params

{
    "credentials_raw"    : {
      "password": "secret"
    },
    "data"     : {
      "name": "Test",
      "email": "test@test.com"
    }
}

Additional Notes

More information on storing credentials linked to a SSO user are located here: - Available Integrations - Data