Are there any examples of how to setup bidirectional communication between Thingworx and an edge device like an Allen Bradley PLC, a Raspberry Pi, or anything else?
What exactly are you trying to do with the REST? Call services/update properties?
Generally there are quite a few blog posts/documents on the community regarding the Pi (please use the search bar at the top to utilize) as well as the whole Edge helpcenter:
Just to add here there's a blog covering setting up C SDK and sending data from RaspberryPi to ThingWorx Using the C SDK to Deliver Data to ThingWorx from a Raspberry PI
To set up bi-directional communication , you need to use Thingworx edge sdks , I have used Java SDK and its achievable through web socket connection.