Structuring your endpoint

To display custom details, we need to load them from your server. This is done by sending a POST request to the URL you provide in your Custom Data settings.

Securing your endpoint

We highly recommend adding headers to secure access to that endpoint specifically for Fernand. You can either:

  • Add an Authorization header with a custom value (like Basic authentication).

  • Use a special key, such as X-Fernand-Key, which will be sent to your server.

On your server's end, you will need to compare the received value to ensure the query is truly coming from Fernand and permit returning data accordingly.

POST request details

When you open a conversation, Fernand sends a POST request to your endpoint using the defined settings. The POST request will contain a JSON body with the following items:

  • email
    Email of the main contact of the conversation.

  • conversation_id
    ID of the conversation in Fernand, useful for tracking or integrating with our API.

  • subject
    Subject of the conversation.

  • agent
    Current agent's email requesting the data, helpful for logging access and actions performed via the custom data.

  • contacts
    An array containing a list of emails, including the main contact's email. This can be useful if the main recipient is not in your database but another recipient is.

Response requirements

Your server must return a JSON response that will be injected into our template engine to render the HTML using your data. Additionally, ensure your server returns a response within 3 seconds to maintain a seamless user experience.

Your server must return a response under 3 seconds.

Sending data back to your server

Your template can include actions in the form of buttons or forms. When adding a data-url parameter to your button, all the headers defined in your settings will be sent along with the request.

In a form, use the action and method parameters to specify the way you want to send back.

For example, if you have defined an X-Fernand-Key in your endpoint settings, the same header will be sent when the button is clicked. This ensures that your endpoint remains dedicated to handling custom data from Fernand within a secure environment.

Was this helpful?