I am trying to use google clouds pub/sub feature to store incoming data from an IOT device. I have an event call back which should be sending a JSON string to the pub/sub topic, from the IOT device's back-end. The callback looks like this (where {project},{topic} and {YOUR_API_KEY} are filled in as required:
POST https://pubsub.googleapis.com/v1/projects/{project}/topics/{topic}:publish?key={YOUR_API_KEY}
{"messages":[{"data":"test"}]}
I am invariably getting error 403 with this set up. I have tried various slight variations on this and found other errors. I am very new to this topic, is there an obvious mistake I am making?