node-red-contrib-platio v0.1.4
Platio Node for Node-RED
This node allows you to create, get, update and delete records in your Plate on Platio.
This node communicates with Platio using Platio API, so you need to know some basics about it. Please read Platio API Documents about Platio API.
OpenBlocks
Try node-red-contrib-platio-openblocks package to use Platio Node for Node-RED on a platform using old node.js like OpenBlocks.
Prepare your Plate and Platio API
- Create your Plate on Platio Studio.
- Add a user to your Plate. Don't forget to check Allow API access to records and attachments.
- Open Platio Data Console of your Plate, and log in with this user.
- Go to the Developer page and check necessary information.
Common configurations
Node configurations
On each node, you can set an application and a collection you're going to use from Node-RED UI.
Configurations per request
You can overwrite configurations you set as described above by setting values to msg.platio
.
msg.platio = {
applicationId: 'pxxxxxxxxxxxxxxxxxxxxxxxxxx',
collectionId: 'txxxxxxx',
authorization: 'Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
};
Error handling
When an error occurs, Platio Node reports it to Node-RED as an error. You can handle errors using catch Node.
Nodes
platio in
Using platio in node, you can get a specified record, or records that matches your search criteria.
In addition to the common configurations, you can configure these properties.
This node retrieves a specified record and set it to msg.payload
when you set Record ID. See Platio API Documents for details about the record format.
It retrieves an array of records if you don't specify Record ID and set it to msg.payload
.
When you set Limit, it retrieves records up to the number specified. It calls API multiple times when you set a value greater than the limit of API (100).
platio out
Using platio out node, you can create a new record, update and delete an existing record.
In addition to the common configurations, you can configure these properties.
This node creates a new record with values specified in msg.payload
when you don't specify Record ID.
It updates a specified record when you specify Record ID. Values not includes in msg.payload
will be removed.
It deletes a specified record when you specify Record ID and set Delete to true
. msg.payload
won't be used in this case.
Specify values to msg.payload
in this format when you create or update a record. Consult Platio API Documents for details.
msg.payload = {
values: {
cxxxxxxx: {
type: 'Number',
value: 20
},
cyyyyyyy: {
type: 'String',
value: 'Text'
}
}
};