使用Zoho API时出现“访问令牌为空”的错误。

huangapple go评论72阅读模式
英文:

Getting "access token is empty" with zoho api

问题

我正在尝试使用我们以前在工作中使用的脚本在site24x7中创建一些监控项...我已经在zoho api中创建了自己的客户端,并按照site24x7关于刷新令牌的文档进行操作。https://www.site24x7.com/help/api/#authentication

问题是我需要首先创建刷新令牌,然后导出这些变量以便运行脚本来创建这些监控项...一切看起来都很好,直到我运行脚本...似乎我做错了什么...我将展示一个示例...

我几乎可以确定问题不在于脚本,因为我只需要编辑一些内容来创建具有名称等的监控项。

有什么想法或者有人之前见过类似的情况吗?

附注:该脚本是用Go语言编写的。

英文:

I'm trying to create some monitors in site24x7 with an script we used to use in my work.... I've created the self client in zoho api and follow the documentation of site24x7 about refresh tokens. https://www.site24x7.com/help/api/#authentication

The thing is I need to frist create the refresh token and then export these variables in other to run the script to create this monitors... everything looks good until I run the script... looks like I'm doing something wrong... I'll show an example...

使用Zoho API时出现“访问令牌为空”的错误。

I'm almost 100% sure that it is not the script because the only thing I need to Edit is something to create the monitor with the name, etc.

Any idea or some one has seeing something similar before?

PD: the script is in go lenguague.

答案1

得分: 2

看起来令牌已经成功从Zoho返回。所以问题可能出在main.go脚本中。如果main.go脚本主要是设置和调用一个http/api调用,那么你可以通过使用curl手动进行该调用来进行调试。

英文:

It looks like the tokens were returned from Zoho successfully. So the issue may be in the main.go script. If the main.go script mainly sets up and calls an http/api call then you might debug by making that call manually with curl.

huangapple
  • 本文由 发表于 2022年9月28日 00:37:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/73871009.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定