Signal

Send a Signal to DFend.

Endpoint

https://api.dfend.app/signal

Accepts requests from client or server environments (publishable or secret API key).

Methods

POST

Send a Signal. Some fields will only be accepted from a server environment.

When using your secret API key, we will create Identities on the fly when we receive Signals with an unrecognized user ID.

Accepts (client environment)

body object An object containing the following subset of Signal fields that are suitable for sending from a client environment:

  • idempotencyKey string optional Prevent duplicate events by providing a unique key for this signal.

  • type string optional A custom string value representing the type of event.

  • source enum A string of value 'App' | 'Browser'.

  • device Device optional An object of Device type.

  • identifiers object An object containing at least one of the following fields:

    • userId string The user's primary key or unique ID in your system.

    • identity string The id value of the user's Identity in DFend.

Accepts (server environment)

body object An object containing the following subset of Signal fields that are suitable for sending from a server environment:

  • idempotencyKey string optional Prevent duplicate events by providing a unique key for this signal.

  • type string optional A custom string value representing the type of event.

  • source enum A string of value 'Server'.

  • device Device optional An object of Device type.

  • identifiers object An object containing at least one primary and any secondary Identifiers.

  • ip string The user's client IP address from the original request you received.

  • userAgent string optional The user's client user-agent from the original request you received.

  • lat number optional The latitude coordinate, if you obtained it from the user's device.

  • lon number optional The longitude coordinate, if you obtained it from the user's device.

  • metadata object optional Custom metadata you wish to add to this Signal.

  • time number optional A Unix timestamp (ms) representing the original time of Signal event.

Returns

A JSON-encoded object containing the following fields:

  • started number A Unix timestamp (ms).

  • finished number A Unix timestamp (ms).

  • immediateResults ImmediateResult[] An array of ImmediateResult objects.

Last updated