[Bug in API] CMD_SECURITY_QUESTIONS bug with parameter order

MaXi32

Verified User
Joined
Jul 25, 2016
Messages
658
Location
The Earth
So when I use the following parameter to pass into CMD_SECURITY_QUESTIONS using curl. One of the following parameters does not work even though the difference is the only parameter order

Sample data:
Code:
question="How are you?"
answer="Ok"

1) This work perfectly

Code:
data="type=custom&value=${answer}&json=yes&action=add&custom_question=${question}"

It has the following success message:

Code:
{
        "result": "",
        "success": "Security Question set"
}

2) This does not work (the only difference is the json=yes part is at the end)

Code:
data="type=custom&value=${answer}&action=add&custom_question=${question}&json=yes"

It has the following error message:

Code:
{
        "error": "Error with Security Questions",
        "result": "Error writing (null) : Unable to b64 encode the session password\n\n"
}

I feel lucky that I knew this error caused by parameter order, or maybe something is missing here, someone else might struggle to understand this error. So hopefully this post help you.
 
Last edited:
Back
Top