A node that can be used for posting information to Ushahidi. It does not support any other ways to interact with Ushahidi as of right now. There might be more nodes added in the future (getting posts, updating data, deleting posts).
Use npm to install locally:
npm install node-red-contrib-ushahidi
Or if you're running a global Node-Red installation:
npm install -g node-red-contrib-ushahidi
Drag the node into the workspace and then set it up by entering the appropriate information in the settings box that shows up when double clicking the node.
msg.title
will be the title of the postmsg.payload
will be the description of the postmsg.loc
is a JavaScript object that includes the location of the post. The latitude should be set in a propertylat
and the longitude inlon
. E.g:msg.loc = {lat: 13, lon: 37}
msg.author
will be the name of the author of the post. Cannot be used when logged on to a non-admin account.msg.email
will be the author's email. Cannot be used when logged on to a non-admin account.msg.formId
will be the id of the form on the Ushahidi deployment. Defaults to 1.
msg.payload
is the payload you get back from the servermsg.statusCode
is the HTTP status code returned by the server
- In order for your posts to show up directly on the map you have to log on using an admin account (and post them as Published not Draft). This is how Ushahidi works and nothing we can do anything about. You can also post using a regular account or without an account (as Draft) but these won't show up on the map until the admin approves them.
- Posting an email address that is not valid will result in an error from Ushahidi. To solve this, simply send no email address at all in your
msg
object.