The Contracted PDA feature allows an application developer to gain short-lived read and write access to PDAs that have given prior permissions for such access.
You must apply to gain access to the Contracted PDA feature. The process to do this is outside the scope of this document. Please contact your Dataswift account manager or [email protected] for more information.
Once access to the Contracted PDA feature is granted, the application developer will be assigned a Contract which defines the namespaces for which read and/or write access are requested. The contract will be tied to the application designed by the developer. When the PDA owner signs on to the application, the HMI screen presented will ask for permissions to have the PDA join the Contract.
This document will show you how to read and write data to the PDA using the Contracted PDA feature. You need to be given access credentials to the Contracted PDA feature by Dataswift.
The access credentials include 2 pieces of information:
Contract Id - <contract_id>
The Contract Id references the assigned Contract, described in the Introduction above
The token node is the Short Lived Access Token. <short_lived_access_token>
The associatedHots contains the PDAs that have joined the contract.
To form the fully qualified domain of the associated PDAs, append the domains hubat.net and hubofallthings.net respectively for sandbox and production environments.
Reading and Writing Data via Contracted PDA API
Both the APIs for reading and writing data via Contracted PDAs are POST commands. The API calls are made to the individual PDAs. Unlike conventional PDA data calls, the ApplicationToken is no longer required in the headers.
To write data:
To read data:
The contract namespace is defined and permitted by the Contract. It is also the namespace on the PDA where data is requested from or written to.