InvergeDocs
PHPAPI reference

Surveys

Surveys in the PHP SDK.

// access
$nexus->surveys()

Surveys

class
class Inverge\Nexus\Resource\Surveys

In-product surveys — fetch the surveys a user is eligible to see and submit their answers. Useful server-side for headless/API surveys and for rendering surveys in server-driven UIs.

View source

__construct

constructor
function __construct(Inverge\Nexus\NexusClient $client)

Parameters

Prop

Type

View source

active()

method
function active(array $options = []): array

The surveys a user is currently eligible to see (targeting + sampling + frequency capping applied server-side).

Parameters

Prop

Type

Returns array<mixed> — list of render-ready surveys

View source

respond()

method
function respond(string $surveyId, array $answers, array $options = []): array

Submit a survey response (partial or complete). Answers are keyed by question id.

Parameters

Prop

Type

Returns array<mixed> — { id, completed }

View source

complete()

method
function complete(string $surveyId, array $answers, array $options = []): array

Submit a completed response in one call.

Parameters

Prop

Type

Returns array<mixed>

View source

dismiss()

method
function dismiss(string $surveyId, array $options = []): array

Record that a user dismissed a survey without completing it.

Parameters

Prop

Type

Returns array<mixed>

View source

On this page