当用户名包含句点时,无法从yammer API获取用户详细信息

编程入门 行业动态 更新时间:2024-10-22 15:40:52
本文介绍了当用户名包含句点时,无法从yammer API获取用户详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我在使用Yammer REST API访问用户详细信息时遇到了一个特殊问题。 我正在使用以下端点来访问用户详细信息 api.yammer/api/v1/oauth/tokens。 json?user_id = USERNAME& consumer_key = CONSUMERTOKEN 问题是用户名不包含句点。 (像johns)API工作正常并且没有给出任何错误,但是当用户名包含句点(john.s)时,API会给出错误的HTTP 400错误请求。 我发送请求如 api.yammer/api/v1/oauth/tokens.json?user_id=john .s& consumer_key = CONSUMERTOKEN 我错过了什么。我正在使用邮递员来测试API并尝试使用C#代码来获得结果,但结果却出现了同样的问题(HTTP 400 Bad request)。 我尝试了什么: 我用postman来测试API端点。当用户名不包含句点(。)但当用户名包含句点(。)时,一切都很好。端点响应是HTTP 400 Bad Request

Hi All, I'm facing a peculiar problem while accessing user details using Yammer REST API. I'm using the following endpoint to access the user details api.yammer/api/v1/oauth/tokens.json?user_id=USERNAME&consumer_key=CONSUMERTOKEN The problem is when the user name does not contains a period "." (like johns) the API is working fine and not giving any error, but when the user name contains a period (john.s) the API is giving error HTTP 400 bad request. I'm sending the request like api.yammer/api/v1/oauth/tokens.json?user_id=john.s&consumer_key=CONSUMERTOKEN Am I missing something. I'm using postman to test the API and also tried with C# code to get the result, but ended with a same problem (HTTP 400 Bad request). What I have tried: I've used postman to test the API endpoint. Everything is fine when the user name does not contains a period (".") but when the user name contains period (".") the endpoint response is HTTP 400 Bad Request

推荐答案

这个问题应该由Yammer提出,而不是一些不支持它的第三方网站。 This question should be brought up with Yammer, not some 3rd party website that doesn't support it.

引用:

我发送请求如 api.yammer/api/v1/oauth/tokens.json ?user_id = john.s& consumer_key = CONSUMERTOKEN

I'm sending the request like api.yammer/api/v1/oauth/tokens.json?user_id=john.s&consumer_key=CONSUMERTOKEN

您需要对QueryString进行URL编码。请阅读: WebUtility.UrlEncode Method(String) (System.Net) [ ^ ] 更新:查看Yammer API文档,OAuth 1.0 a不受支持。您需要使用OAuth 2.0。 REF: OAuth 2:Server&客户端流程·Yammer开发人员网站 [ ^ ]

You need to URL encode your QueryString. Please read this: WebUtility.UrlEncode Method (String) (System.Net)[^] UPDATE: Looking at the Yammer API documentation, OAuth 1.0a is not supported. You need to use OAuth 2.0. REF: OAuth 2: Server & Client-Side Flow · Yammer Developer Site[^]

Quote:

www.yammer/oauth2/authorize?client_id= [:CLIENT_ID]&安培; response_type = code& redirect_uri = [:redirect_uri] [ ^ ]

更多推荐

当用户名包含句点时,无法从yammer API获取用户详细信息

本文发布于:2023-11-17 08:24:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609454.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:详细信息   句点   用户名   用户   yammer

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!