Stephen Stephen - 6 months ago 44
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)


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.