Moodle for mobile

"Invalid response value detected"

Picture of Dani Palou
Re: "Invalid response value detected"
Core developersMoodle HQParticularly helpful MoodlersPlugin developers

Hi Peter,

if you set the debug level to "Developer" the WS response should give you a better error message, telling you exactly which field is failing. Can you copy it here?

IMO the error "Missing parameter (token)" pasted above shouldn't be related to this.



Average of ratings: -
Picture of Rafiq Muhammad
Re: "Invalid response value detected"

Hi Dani,

Have the same problem and this is the response in full debug. FYI, the data in message already encoded into json.

stdClass Object
    [exception] => invalid_response_exception
    [errorcode] => invalidresponse
    [message] => Invalid response value detected
    [debuginfo] => message => Invalid response value detected: Invalid external api response: the value is "{"status":"1","result":{"id":"1","category":"0","sortorder":"1","fullname":"RCYCI E-Learning","shortname":"RCYCI E-Learning","idnumber":"","summary":"<p>E-Learning in RCYCI<br><\/p>","summaryformat":"0","format":"site","showgrades":"1","newsitems":"10","startdate":"0","marker":"0","maxbytes":"0","legacyfiles":"0","showreports":"0","visible":"1","visibleold":"1","groupmode":"0","groupmodeforce":"0","defaultgroupingid":"0","lang":"","calendartype":"","theme":"","timecreated":"1424755022","timemodified":"1480511045","requested":"0","enablecompletion":"0","completionnotify":"0","cacherev":"1539779835"}}", the server was expecting "text" type

Average of ratings: -
Picture of Rafiq Muhammad
Re: "Invalid response value detected"


Apparently I found that one of my field has HTML code and my return type has been set as PARAM_TEXT.

In this thread (, Davo Smith recommended to use PARAM_TEXT for JSON type.


Average of ratings: -