“无效的JSON”,“错误”:“invalid_value”

时间:2016-06-21 03:00:28

标签: json authentication oauth-2.0 bad-request podio

您好我正在尝试使用workato为Podio创建任务。我已经使用他们的HTTP OAUTH2连接成功连接到Podio,但是当我尝试使用JSON实际创建任务时,我从Podio收到此信息: 这是来自HTTP:

  

400错误请求:   { “error_parameters”:{}, “ERROR_DETAIL”:NULL, “error_propagate”:假, “请求”:{ “URL”: “http://api.podio.com/task/”, “QUERY_STRING”: “” , “方法”: “POST”}, “ERROR_DESCRIPTION”:“无效   JSON”, “错误”: “INVALID_VALUE”}

守则如下:

Request URL : https://api.podio.com/task/item/"the item id" <--This is where I would place the itemID of the item in Podio

Request header:
Authorization: OAuth2 [[User.SiteAccessToken]]
Content-type: application/json

Request Body:
  {
    "text": "Regarding Absence Request for Vacation",
    "responsible":"{"type":profile, "id": "this is my profileID" }",
    "description": "Your request for Vacation has been denied, please contact your manager."
  }

但是当我运行它时,我收到此错误消息:

  

400错误请求:   { “error_parameters”:{}, “ERROR_DETAIL”:NULL, “error_propagate”:假, “请求”:{ “URL”: “http://api.podio.com/task/item/436023600”, “QUERY_STRING” : “”, “方法”: “POST”}, “ERROR_DESCRIPTION”:“无效   JSON”, “错误”: “INVALID_VALUE”}

现在在请求正文或标题内,它需要具有我所指的应用程序,而不仅仅是项目ID。不知道它在寻找什么,如果你可以请一些指导,非常感谢。

1 个答案:

答案 0 :(得分:2)

我发现问题确实是请求正文中发送的JSON中的语法。

负责的大括号周围的引号需要删除,我需要带有简档的引号,它应该是这样的:

{
  "text": "Regarding Absence Request for Vacation",
  "responsible": {"type":"profile", "id": 123 },
  "description": "Your request for Vacation has been denied, please contact your manager."
}