2017-06-13 10:22:11 0 Comments PHP Boy.Lee

AliYun SMS API return InvalidParamString.MalFormed error

When use AliYun SMS API send SMS, will return error 400 - InvalidParamString.MalFormed in chance, the explain in Error Code List is: The specified paramString is wrongly formed. So the problem is ParamString.


{ Analysis }

Let's check the ParamsString in Url.

// correct

// error


Let's use iTool to do online decode(http://itool.yiilib.com/#/t/urlEncode)

// correct

// error


{ Result }

So, the 123456 was encodeed as integer in json_encode. But standard JSON format need all element under "", so that's the problem. The reason why I got this error intermittent is because after save and load it from Database, it will be used as string.