Well-formed JSON post
Hi - I'm looking for help with posting a new item into Podio via the API. I need to see an example of a well-formed JSON object. The Post I'm generating looks right, but is failing and I'd like to compare it with a known good example. More information on this project can be found in my earlier post on creating Podio items in classip ASP
-
Hi Adrian,
could you provide some details, like the POST data you are sending, your app structure and the error you are seeing. Otherwise nobody will be able to help you.
Best,
Stefan--
Die Kollaborateure / Podio Preferred Partner
http://www.diekollaborateure.com/go/podio/help -
You can use http://jsonlint.com/ to validate your JSON. Otherwise, post your failing JSON so we can take a look
-
Thanks for the offers of help. Here is the error response I am getting back from the API showing my original post:
{"fields":{"Title":"NM131482-Seminars","category":3,"status":2,"deadline-date":[{"startDate":"2014-10-04"}],"strategy-reference":2551097,"progress":10,"last-update":"2014-04-09","responsibly-person":659257}}{"error_parameters":{},"error_detail":null,"error_propagate":false,"request":{"url":"http:\/\/api.podio.com\/item\/app\/7661778\/","query_string":"","method":"POST"},"error_description":"Invalid value null (null): must be object","error":"invalid_value"}
-
The script used to produce the JSON post looks like this:
function update_post(content)
Dim objSvr2HTTP
Set objSvr2HTTP = Server.CreateObject("MSXML2.XMLHTTP")
objSvr2HTTP.open "POST", "https://api.podio.com/item/app/7661778/", false
objSvr2HTTP.setRequestHeader "Content-Type", "application/json"
objSvr2HTTP.setRequestHeader "Authorization", "OAuth2 "&varAccess_Token
objSvr2HTTP.send content
update_post=objSvr2HTTP.responseText
set objSvr2HTTP=nothing
end function -
Thanks Andreas - that's really helpful. I can see you are definitely right about the Title field. With the start date, someone told me that start and end dates should be held in an array, which is why I did it like that. Maybe I need to go back to just a straight name:value pair. Anyway, I'll make those changes and let you know how I get on. Thanks again for your help.
-
Hi Andreas - I made the changes you suggested, but still getting errors. Here is the response from the API
{"fields":{"title":"NM131526-Visitor 3","category":3,"status":2,"deadline-date":"2014-10-04","strategy-reference":141145201,"progress":10,"last-update":"2014-04-09","responsibly-person":659257}}{"error_parameters":{},"error_detail":null,"error_propagate":false,"request":{"url":"http:\/\/api.podio.com\/item\/app\/7661778\/","query_string":"","method":"POST"},"error_description":"Invalid value null (null): must be object","error":"invalid_value"}
-
Use this to validate your JSON: JSON Formatter
Please sign in to leave a comment.
Comments
9 comments