Stephen Stephen - 1 year ago 89
Ruby Question

Action permission error with Stream API

I keep getting "You do not have permission to perform this action." when attempting to connect. What am I missing?

url = ''

payload = {
'resource' => 'feed',
'action' => 'read',
'feed_id' => 'user:12353253'

token = JWT.encode(payload, secret, 'HS256')

options[:headers] = {
'Authorization' => token,
'stream-auth-type' => 'jwt'

response = HTTParty.get(url, options)

Answer Source

It looks like you got everything right except for the value for feed_id in the payload. It should be the "user12353253" instead of "user:12353253" (no semicolon).

P.S. I am one of the founders of Stream, REST API does not explain this well. We will update them asap.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download