Skip to main content

Request Access

For each protected capability, a Direct Device creates a pending request in the ACCESS service. The Project owner must approve it, and an unapproved request expires after 48 hours.

Endpoint​

/api/v1/AccessControl/AddPendingAccessControlForDevice

Authentication​

Authenticate with the Device configuration-file token and handle it as a secret. The current public source does not specify where this token is delivered or acquired, nor the header name or exact transport format. Confirm those details with your AirNgin integration contact or the approved SDK for the deployment before implementing this call.

This token is distinct from MQTT username/password credentials, the Producer API credential, the Dedicated Setting temporary token, a Gateway API token, and AppSecretKey. Do not substitute one for another.

Form data​

FieldTypeRequiredPurpose
TriggerPointstring?NoIdentifies the requesting/source Device.
ProjectIdGuid?NoRelated Project identifier.
TargetTypeTargetType?NoRequested permission type.
Valuestring?NoTarget value, such as a Device serial or scenario code, according to the permission.

Preserve the exact field names and casing.

Unspecified parts of the contract

The source does not define the HTTP method, exact authentication header, exact form content type, response schema, or owner-approval notification mechanism. Do not invent examples for these details; obtain them from the SDK or deployment contract.

TargetType values​

NameValuePurpose
DisableScenario10Disable a scenario.
EnableScenario11Enable a scenario.
ServerScenarioInfo12Request server scenario information.
RunServerScenario13Run a manual scenario.
SendToSerial20Send a command to another Device.
ListenFromSerial21Receive another Device's live changes.
GetSerialLastValue22Get another Device's last value.
About GetSerialLastValue

Permission 22 is part of the access contract, and related names appear in the topic reference, but the current public sources do not provide a complete, versioned snapshot request/response payload and behavior contract. Confirm it against the deployed Backend/SDK before implementation.

Request lifecycle​

  1. The Device submits the form using the configuration-file token confirmed for that Device.
  2. The request enters the pending state.
  3. The Project owner approves or rejects it.
  4. A pending request expires after 48 hours.
  5. Firmware enables the capability only after approval.

Because the response and approval-notification schemas are unspecified, an HTTP response or locally saved setting is not by itself proof of approval.

Least privilege​

A panel that only controls a light and displays its state should request only SendToSerial = 20 and ListenFromSerial = 21. Request scenario or last-value permissions only when the product uses them.

Troubleshooting​

ProblemCheck
Endpoint returns 404Verify AddPendingAccessControlForDevice spelling and the ACCESS service base URL.
Authentication failsConfirm the token source and header contract with the integration contact or approved deployment SDK.
Capability does not work after submissionConfirm owner approval and that the 48-hour window has not expired.
Wrong permission is createdCompare numeric TargetType and Value with the table above.
Integration depends on a particular response bodyRemove that assumption until the deployment's official response schema is available.

Next: Control, state, and scenarios over MQTT.