MachineQ Developer Documentation logo DOCS

Quick Start

Go from a fresh MQcentral account to your first decoded uplink in under fifteen minutes.

Before You Begin

  • An MQcentral account with Create and Read permissions for Device Administration. See Roles for details.
  • A LoRaWAN device with its DevEUI, ApplicationEUI (JoinEUI/AppEUI), and ApplicationKey. These are printed on the device or supplied by the manufacturer.
  • A gateway deployed and connected to the MachineQ network.
  • curl and jq installed locally.

Windows Users: The shell commands throughout this guide have been tested with Bash. If you are using PowerShell, the syntax may differ. For the best experience on Windows, we recommend using Windows Subsystem for Linux (WSL) or Cygwin to run the commands as written.

Step 1: Generate API Credentials

In MQcentral, go to Integrations → Application Management → Add Application. Name the application and save the client_id and client_secret; the secret is shown only once.

See Roles & Permissions for custom role creation and Authentication & API Access for more on API auth.

Step 2: Get an Access Token

Fetch an access token
export MQ_CLIENT_ID="YOUR_CLIENT_ID"
export MQ_CLIENT_SECRET="YOUR_CLIENT_SECRET"

curl -sS -X POST https://identity.machineq.net/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=$MQ_CLIENT_ID" \
  -d "client_secret=$MQ_CLIENT_SECRET"

Export the token from the response:

Export your access token
export MQ_TOKEN="<access_token_from_response>"

Step 3: Provision a Test Device

3a. Look Up Profile IDs

Device creation requires a Service Profile ID and a Device Profile ID:

List service and device profiles
curl -sS -H "Authorization: Bearer $MQ_TOKEN" \
  "https://api.machineq.net/v1/serviceprofiles" | jq

curl -sS -H "Authorization: Bearer $MQ_TOKEN" \
  "https://api.machineq.net/v1/deviceprofiles" | jq

Save the Id from each response.

3b. Create the Device

MachineQ Devices: If you are provisioning an official MachineQ device, please contact MachineQ Support instead. All MachineQ devices are typically preprovisioned by our support team. The steps below are intended for provisioning third-party LoRaWAN devices.

ActivationType accepts OTAA or ABP. OTAA is recommended.

Create a new device
curl -sS -X POST https://api.machineq.net/v1/devices \
  -H "Authorization: Bearer $MQ_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "DevEUI": "<dev_eui>",
    "ApplicationEUI": "<application_eui>",
    "ApplicationKey": "<application_key>",
    "Name": "quickstart-flex-01",
    "ActivationType": "OTAA",
    "ServiceProfile": "<service_profile_id>",
    "DeviceProfile": "<device_profile_id>"
  }' | jq
API reference:

The API uses the DevEUI as the primary device identifier. Export it:

Export the new device's DevEUI
export MQ_DEV_EUI="<dev_eui>"

Step 4: Power On and Watch It Join

Power on or power-cycle the device. Within a minute or two, a join entry appears in MQcentral under Devices → quickstart-flex-01 → Log Stream.

Query join activity via the API:

Fetch the device logs
curl -sS -H "Authorization: Bearer $MQ_TOKEN" \
  "https://api.machineq.net/v1/logs?DevEUI=$MQ_DEV_EUI" \
  | jq '.Logs[] | {Timestamp, MessageType, MessageTypeText}'
API reference:

Look for "Join request" or "Join accept" entries. Use the Page query parameter to paginate.

After joining, the device sends uplinks on its configured interval. Pull recent uplinks:

Fetch the device payloads
curl -sS -H "Authorization: Bearer $MQ_TOKEN" \
  "https://api.machineq.net/v1/devices/$MQ_DEV_EUI/payloads" \
  | jq

Each Payloads entry contains:

  • Time: when the uplink was received
  • ApplicationData: decoded payload (if a decoder is configured)
  • Data: raw network-server metadata

For the raw hex payload and signal metadata:

Fetch the device logs
curl -sS -H "Authorization: Bearer $MQ_TOKEN" \
  "https://api.machineq.net/v1/logs?DevEUI=$MQ_DEV_EUI" \
  | jq '.Logs[0] | {PayloadHex, PrimaryGatewayRSSI, PrimaryGatewaySNR, SpreadingFactor}'
API reference:

See Working with Device Data to configure a payload decoder.

What's Next?

All of the above curl requests are using the MQCentral v1 API. For the full API reference: https://docs.machineq.net/machineq-api-v1.html.