How to use Getstream Rest API to get response in Postman?(如何使用 Getstream Rest API 在 Postman 中获取响应?)
问题描述
我正在尝试实现 Stream chat Rest API(通过以下链接:https://getstream.io/chat/docs_rest )由 GetStream 提供.因此,我将 baseUrl 和预期的标头以下列方式放置:
I am trying to implement Stream chat Rest APIs ( by following this link : https://getstream.io/chat/docs_rest ) provided by GetStream. So, I put the baseUrl and expected headers in following ways :
Request Url : https://chat-us-east-1.stream-io-api.com/channeltypes
这些是我在 Postman 的 Headers 部分中输入的值:
These are the values which I put in Headers section of Postman :
Authorization : <Getstream token (generating from setUser function) from backend>
Stream-Auth-Type: jwt
api_key : <Getstream API key>
但我在使用 Postman 上的 API 时收到此响应:
But I am getting this response on hitting API on Postman:
{代码":17,"message": "ListChannelTypes failed with error: "频道类型只能用服务器端认证描述"",状态代码":403,持续时间":0.00ms"}
{ "code": 17, "message": "ListChannelTypes failed with error: "Channel types can be described only with server-side auth"", "StatusCode": 403, "duration": "0.00ms" }
我无法找出我在使用 Getstream 的 Rest API 时遗漏了什么或做错了什么.请提出建议并帮助解决此问题.
I am unable to find out what I am missing or doing wrong in using the Rest API of Getstream. Please suggest and help in fixing this issue.
推荐答案
如错误信息所述:
频道类型只能使用服务器端身份验证来描述
Channel types can be described only with server-side auth
只有通过服务器端身份验证才有可能.
It's only possible with server side authentication.
当您使用 Authorization: <Getstream token (generating from setUser function) from backend> 时,这是针对客户端的.
When you use Authorization: <Getstream token (generating from setUser function) from backend>, this is for client-side.
您需要在令牌中使用您的秘密来启用服务器端并在此端点中进行 gueary.
You need to use your secret in the token to enable server-side and to gueary in this endpoint.
这篇关于如何使用 Getstream Rest API 在 Postman 中获取响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 Getstream Rest API 在 Postman 中获取响应?
基础教程推荐
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iOS4 创建后台定时器 2022-01-01
