Response structure (version-2.8.0 and above)
Response Structure :
Failed Response :
Status code : 0
Message : error message
Data : null
ValidationMessage : []
ErrorMessage : exception/error message
Success Response :
Status code : 1
Message : success message
Data : response object
ValidationMessage : []
ErrorMessage : null
Request served but validation error Response :
Status code : 2
Message : error message
Data : null
ValidationMessage : validation message list
ErrorMessage : null
When Api Secreate key is incorrecrt (unauthorized) :
Parameter :
{
"ApiSecretKey":"i99b98d117m116a112o98k115c111@#/",
"StoreId":"",
"UserName":"",
"Password":"",
"CustomerGUID":""
}
Response :
{
"Status": 401,
"Message": "Unauthorized Request.",
"Data": null,
"ValidationMessage": [],
"ErrorMessage": "Unauthorized Request. Please check System Logs for more details or contact your System Administrator."
}
When Request is empty (Or it is because of GUID parameter)
=> If CustomerGUID : "" Or Date:"abcd" (Date sent in string while it is of type date-time) sent like this you will get below error response.
{
"Status": 0,
"Message": "Request cannot be empty",
"Data": null,
"ValidationMessage": [],
"ErrorMessage": null
}
When unhandle exception occur it gives response as following and ErrorMessage may be different according to methods :
{
"Status": 0,
"Message": null,
"Data": null,
"ValidationMessage": [],
"ErrorMessage": "Exception of type 'System.Exception' was thrown."
}