Search code examples
jsonauthenticationoauth-2.0bad-requestpodio

"Invalid JSON","error":"invalid_value"


Hi I am trying to use workato to create a task for Podio. I have successfully connected to Podio using their HTTP OAUTH2 connection, but when I try to actually create the task using JSON, I receive this from Podio: This is from HTTP:

400 Bad Request: {"error_parameters":{},"error_detail":null,"error_propagate":false,"request":{"url":"http://api.podio.com/task/","query_string":"","method":"POST"},"error_description":"Invalid JSON","error":"invalid_value"}

The Code is as follows:

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."
  }

but when I run this, I get this error message:

400 Bad Request: {"error_parameters":{},"error_detail":null,"error_propagate":false,"request":{"url":"http://api.podio.com/task/item/436023600","query_string":"","method":"POST"},"error_description":"Invalid JSON","error":"invalid_value"}

Now within the the request body or header does it need to have which app I am referring to not just the item ID. Not sure what it's looking for, if you could please assist with some guidance, that would be greatly appreciated.


Solution

  • I discovered that the issue was indeed the syntax within the JSON sent in the request body.

    The quotes around the curly braces for responsible needed to be removed and I needed quotes with profile, and it should have gone like this:

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