- Posts: 5
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
The content-type of the HTTP request must be application/json. Most formatting errors are a failure to set the content-type header. This will result in a null response from the server (not a JSON response).
The parameter structure uses arrays of values - you *must* send the values in the API expected order (see jsonrpc specification ).
@param string $sDocumentType any format available by plugins (for example : pdf, csv, xls, doc, json)
"{\"method\":\"export_responses\",\"params\":[\"JatBameDZtYllc9jGFCvZnZeUWXUrjVI\",534582,\"json\"]}"
accept-encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3 accept: */* user-agent: Ruby host: my.instance.org content-type: application/json connection: Keep-Alive content-length: 89
"{\"method\":\"export_responses\",\"params\":[\"mCazeazeaezIOkJ~K5RC29anh1sq~m\",534582,\"json\"],\"id\":1}"
JSON-RPC ! not related to LimeSurvey implementation.I solved my problem by passing "id": 1 as additional parameter (as in other snippets)
The full payload isCode:"{\"method\":\"export_responses\",\"params\":[\"mCazeazeaezIOkJ~K5RC29anh1sq~m\",534582,\"json\"],\"id\":1}"
If you've time,
Why is this parameter needed ? Is it a LimeSurvey requirement, or a JSON/RPC one ? Can't see any reference to it in the documentation