gpt4 book ai didi

ruby - Stream API 的操作权限错误

转载 作者:数据小太阳 更新时间:2023-10-29 08:43:39 25 4
gpt4 key购买 nike

我不断收到“您无权执行此操作”。尝试连接时。我错过了什么?

url = 'https://api.getstream.io/api/v1.0/feed/user/12353253/?api_key=API_KEY'

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)

最佳答案

除了负载中 feed_id 的值外,您似乎一切都正确。它应该是“user12353253”而不是“user:12353253”(没有分号)。

附言我是 Stream 的创始人之一,REST API 对此没有很好的解释。我们会尽快更新它们。

关于ruby - Stream API 的操作权限错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39984405/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com