SugarCRM 5.5.2 Rest api -- 登录失败

发布于 2024-09-26 15:46:42 字数 601 浏览 1 评论 0原文

我需要能够使用 SugarCRM 的 API 与其他几个应用程序交换信息。我找到了 api 文档,以及一些带有示例代码的好文章。我的代码的最终结果是发送以下命令:

http://localhost/sugarcrm/service/v2/rest.php?method=login&input_type=json&response_type=json&rest_data={%22user_name%22:%22rest%22,% 22password%22:%2265e8800b5c6800aad896f888b2a62afc%22,%22version%22:%22.01%22}

这会产生此错误 {"name":"无效登录","number":10,"description":"登录尝试失败,请检查用户名和密码"}null

我已在 google 上搜索了该错误,并发现其他几个人也存在此问题,但没有解决方案。

I need to be able to use the API for SugarCRM to exchange information with several other applications. I found the api docs, and some good articles with sample code. The end result of my code is to send this command:

http://localhost/sugarcrm/service/v2/rest.php?method=login&input_type=json&response_type=json&rest_data={%22user_name%22:%22rest%22,%22password%22:%2265e8800b5c6800aad896f888b2a62afc%22,%22version%22:%22.01%22}

Which produces this error
{"name":"Invalid Login","number":10,"description":"Login attempt failed please check the username and password"}null

I have googled the error and found several others with this issue, but no solution.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

铜锣湾横着走 2024-10-03 15:46:42

我认为正确的 REST 字符串如下:

method=login&input_type=json&response_type=json&rest_data={"user_auth": {"user_name":"user","password":"somemd5hash","version": "1.0"},"application_name":"RestTest"}

(当然应该进行 url 编码)

I think the proper REST string would be like:

method=login&input_type=json&response_type=json&rest_data={"user_auth": {"user_name":"user","password":"somemd5hash","version":"1.0"},"application_name":"RestTest"}

(should be url-encoded then of course)

你是暖光i 2024-10-03 15:46:42

对我来说,我需要使用以下内容:

method=login&input_type=JSON&response_type=JSON&rest_data=$REST_DATA

REST 数据是:

{
  user_auth => {
    user_name => $USERNAME,
    password => $PW,
    version => "1.2"
  },
  application => "foo"
}

(URL 编码)

For me, I needed to use something along the lines of:

method=login&input_type=JSON&response_type=JSON&rest_data=$REST_DATA

The REST data is:

{
  user_auth => {
    user_name => $USERNAME,
    password => $PW,
    version => "1.2"
  },
  application => "foo"
}

(URL encoded)

忘羡 2024-10-03 15:46:42

URL:http://mycrmurl.com/service/v4/rest.php

请求数据- 在 POST 方法中

method=login&input_type=JSON&response_type=JSON&rest_data={"user_auth":{"user_name":"username","password":"md5password","version":"1.0"}," application_name":"RestTest"}

来自 WS 的响应:

{"id":"someID","module_name":"Users","name_value_list":{"user_id":{"name":"user_id","value": "1"},"用户名":{"名称":"用户名","值":"用户名"},"用户语言":{"名称":"用户语言","值":"en_us"}," user_currency_id":{"name":"user_currency_id","value":"-99"},"user_is_admin":{"name":"user_is_admin","value":true},"user_default_team_id":{"name" :"user_default_team_id","value":null},"user_default_dateformat":{"name":"user_default_dateformat","value":"m/d/Y"},"user_default_timeformat":{"name":"user_default_timeformat" ,"value":"h:ia"},"user_number_seperator":{"name":"user_number_seperator","value":","},"user_decimal_seperator":{"name":"user_decimal_seperator","value" :"."},"mobile_max_list_entries":{"name":"mobile_max_list_entries","value":null},"mobile_max_subpanel_entries":{"name":"mobile_max_subpanel_entries","value":null},"user_currency_name": {"name":"user_currency_name","value":"美元"}}}

URL : http://mycrmurl.com/service/v4/rest.php

Request Data - in POST method

method=login&input_type=JSON&response_type=JSON&rest_data={"user_auth":{"user_name":"username","password":"md5password","version":"1.0"},"application_name":"RestTest"}

Response from WS:

{"id":"someID","module_name":"Users","name_value_list":{"user_id":{"name":"user_id","value":"1"},"user_name":{"name":"user_name","value":"username"},"user_language":{"name":"user_language","value":"en_us"},"user_currency_id":{"name":"user_currency_id","value":"-99"},"user_is_admin":{"name":"user_is_admin","value":true},"user_default_team_id":{"name":"user_default_team_id","value":null},"user_default_dateformat":{"name":"user_default_dateformat","value":"m/d/Y"},"user_default_timeformat":{"name":"user_default_timeformat","value":"h:ia"},"user_number_seperator":{"name":"user_number_seperator","value":","},"user_decimal_seperator":{"name":"user_decimal_seperator","value":"."},"mobile_max_list_entries":{"name":"mobile_max_list_entries","value":null},"mobile_max_subpanel_entries":{"name":"mobile_max_subpanel_entries","value":null},"user_currency_name":{"name":"user_currency_name","value":"US Dollars"}}}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文