Skip to content

Getting Started with Linq

This walks through everything needed to make your first /synqpay/rpc call: creating an OAuth Client Application in DMS, obtaining an access token, and calling a device.

Prerequisites

  • A DMS account with at least one device already configured and enabled for RPC.
  • The two Linq hosts for your environment (<linq-auth-host> and <linq-application-host>), provided to you separately — see Endpoints.

Step 1 — Log in to DMS

Log in to your DMS account at your organization's DMS URL.

Step 2 — Create an OAuth Client Application

  1. Navigate to your account's Integrations section.
  2. Create a new OAuth Client Application.
  3. Note the generated Client ID and Client Secret — the secret is shown only once.

Warning

Store the client secret securely (e.g. a secrets manager). It cannot be retrieved again from DMS — if lost, you'll need to rotate it and generate a new one.

Step 3 — Request an access token

Exchange your client credentials for an access token via the client_credentials grant:

1
2
3
4
5
6
curl -X POST https://<linq-auth-host>/oauth2/token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'grant_type=client_credentials' \
  -d 'client_id=<client_id>' \
  -d 'client_secret=<client_secret>' \
  -d 'scope=linq/rpc'

Response:

1
2
3
4
5
{
    "access_token": "eyJra...",
    "token_type": "Bearer",
    "expires_in": 3600
}

Tokens expire (expires_in seconds) — cache and reuse a token until shortly before it expires rather than requesting a new one per call.

Step 4 — Call your device

Using the access_token from Step 3:

curl -X POST https://<linq-application-host>/synqpay/rpc \
  -H 'Authorization: Bearer <access_token>' \
  -H 'X-Device-ID: <device-id>' \
  -H 'X-Idempotency-Key: <a-unique-key>' \
  -H 'Content-Type: application/json; charset=utf-8' \
  -d '{
    "jsonrpc": "2.0",
    "method": "getDeviceInfo",
    "id": "1234",
    "params": null
}'

A successful call returns HTTP 200 with X-Request-Status: COMPLETED and the device's own JSON-RPC response in the body.