GET

/user/connect/token

x-api-key*
curl --request GET \
  --url https://api.sandbox.metriport.com/user/connect/token \
  --header 'x-api-key: <x-api-key>'

Query Params

userIdrequired
string

The Metriport user ID to create a session token for.

Response

tokenrequired
string

The temporary token to allow the specified user to access the Metriport Connect widget.

The token will expire 10 minutes after it is created, and can be reused for the duration of the session.
{
  "token": "YXM-S_TFApXrAjLpfdmdG"
}
import { MetriportDevicesApi } from "@metriport/api-sdk";

const metriportClient = new MetriportDevicesApi("YOUR_API_KEY");

const response = await metriportClient.getConnectToken("metriportUserId");