Skip to main content

core.medplumclient.pushtoagent

Home > @medplum/core > MedplumClient > pushToAgent

MedplumClient.pushToAgent() method

Pushes a message to an agent.

Signature:

pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device> | string, body: any, contentType?: string, waitForResponse?: boolean, options?: MedplumRequestOptions): Promise<any>;

Parameters

ParameterTypeDescription
agentAgent | Reference<Agent>The agent to push to.
destinationDevice | Reference<Device> | stringThe destination device.
bodyanyThe message body.
contentTypestring(Optional) Optional message content type.
waitForResponseboolean(Optional) Optional wait for response flag.
optionsMedplumRequestOptions(Optional) Optional fetch options.

Returns:

Promise<any>

Promise to the result. If waiting for response, the result is the response body. Otherwise, it is an operation outcome.