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
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 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:
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.
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
The API uses the DevEUI as the primary device identifier. Export it:
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:
curl -sS -H "Authorization: Bearer $MQ_TOKEN" \
"https://api.machineq.net/v1/logs?DevEUI=$MQ_DEV_EUI" \
| jq '.Logs[] | {Timestamp, MessageType, MessageTypeText}'
Look for "Join request" or "Join accept" entries. Use the Page query parameter to paginate.
Step 5: View Your First Uplink
After joining, the device sends uplinks on its configured interval. Pull recent uplinks:
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 receivedApplicationData: decoded payload (if a decoder is configured)Data: raw network-server metadata
For the raw hex payload and signal metadata:
curl -sS -H "Authorization: Bearer $MQ_TOKEN" \
"https://api.machineq.net/v1/logs?DevEUI=$MQ_DEV_EUI" \
| jq '.Logs[0] | {PayloadHex, PrimaryGatewayRSSI, PrimaryGatewaySNR, SpreadingFactor}'
See Working with Device Data to configure a payload decoder.
What's Next?
- Roles & Permissions: Custom roles for provisioning, gateway management, and user administration.
- Applications: Create and manage OAuth2 service accounts for API access.
- Data Delivery: Output Profiles: Route device data via REST, MQTT, AWS IoT Core, or Azure IoT Hub.
- Device Onboarding & Lifecycle: Device profiles, LoRaWAN classes, groups, and lifecycle management.
- Operations & Best Practices: Review before going to production.
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.