Open rwu2359 opened 7 years ago
I'll have to take a look. I can't remember
@rwu2359 will you check the latest version. See if this has been resolved for you
Latest version breaks the request. Because dataQuoted is not set as a parameter it is turning the data part of the post to ?, which the API is rightly reading as not valid JSON...
on line #59
not IsEmpty ( $Data ) & $dataQuoted
fails as $dataQuoted = "dataQuoted" does not exist, as it is the error from the JsonGet CF. Better test - not isempty (..) and PatternCount ( $dataQuoted ; "not exist" ) > 0 ???
Ok, so I see how that could be.
OK can you try it now. Latest version 1.0.5 See if that fixes it.
Thanks
Fogbugz has been down for a bit. This issues is now fixed with the latest version, except it brings up another issue which I will raise separately about handling returned body which contains just some html, no identifiable JSON
result of getting a token as per image
using { "name": "Fogbugz token", "notes": "", "request": { "method": "POST", "url": "https://rwu.fogbugz.com/f/api/0/jsonapi", "query": {}, "headers": { "Content-Type": "application/json" }, "data": { "cmd": "logon", "email": "myemail", "password": "mypassword" } } }
using API kitchen the results returned are {"data":{"token":"k4i43mp1jljkmrajnjkkl1e76a3hsb"},"errors":[],"warnings":[],"meta":{"jsdbInvalidator":"XgTKsKzswka68vt6hyndjA2","clientVersionAllowed":{"min":4,"max":4}},"errorCode":null,"maxCacheAge":null}
and headers Access-Control-Allow-Origin: * Content-Type: text/javascript; charset=utf-8 Connection: close Strict-Transport-Security: max-age=15552000 Date: Sun, 06 Nov 2016 12:27:39 GMT X-Frame-Options: SAMEORIGIN Content-Encoding: gzip Content-Length: 185 Cache-Control: private, max-age=0 Vary: Accept-Encoding
This issue can be fixed by changing line #130 in the HTTP script in Generator to IF ( $contentType = "application/json" or $contentType = "text/javascript" )
Why is this section (#125--136) in the Generator script not in the script that gets copied to user files??