如何使用 Getstream Rest API 在 Postman 中获取响应?

How to use Getstream Rest API to get response in Postman?(如何使用 Getstream Rest API 在 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 中获取响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)