Skip to main content
Version: 5.9.6

BackendReturnObject(Return Value)

BackendReturnObject is a class that stores the value passed due to communication.
All functions requested to the server using BACKND SDK are returned as a BackendReturnObject class format.

ValueTypeDescription
statusCodestringStatus code passed from the server
errorCodestringCode that signals error information
messagestringDetails of success/failure passed from the server
returnValuestringData delivered in JSON format by the server when the request succeeds

BackendReturnObject contains the response to the request in returnValue. This is in JSON format.
The JSON library uses LitJson, and you can check the api here.

Example

BackendReturnObject bro= Backend.BMember.AuthorizeFederation("AccessToken", FederationType.Google);

if(bro.IsSuccess() == false) {
// 서버에 에러가 리턴되었다면
Debug.Log(bro.ToString()); // 에러 정보 확인
return;
}

// Convert the server's response to a JSON object
var json = bro.GetFlattenJson();

List of BackendReturnObject methods

MethodReturn TypeDescription
Clear()voidResets information
GetStatusCode()stringGets statusCode value
GetErrorCode()stringGets errorCode value
GetMessage()stringGets message value
HasReturnValue()boolChecks if returnValue exists
GetReturnValue()stringGets returnValue value
GetReturnValuetoJSON()JsonDataGets returnValue value by converting it to JsonData
ToString()stringIf statusCode, errorCode, message, and returnValue
are present, converts them to a string format
HasRows()boolChecks if rows exist in returnValue
Rows()JsonDataReturns rows in returnValue by converting them to JsonData
HasInDate()boolChecks if inDate exists in returnValue
GetInDate()stringReturns inDate in returnValue
HasFirstKey()boolCheck if firstKey exists in returnValue
FirstKey()JsonDataReturns firstKey in returnValue by converting it to JsonData
FirstKeystring()stringReturns firstKey in returnValue by converting it to a string
JsonDataContaionsKey
(JsonData data, string key)
boolReturns the key after confirming it is present in the data
IsSuccess()boolConfirms whether the request succeeded or failed
(Successful: 2xx statusCode, Failed: 3xx or higher statusCode)
IsServerError()boolReturns Return statusCode by determining whether it is a server error(5xx)
LastEvaluatedKeyString()stringReturns LastEvaluatedKey in returnValue
by converting it to a string(used as notice/event offset)
Flatten(JsonData jsonData)JsonDataReturns data format in JsonData by unmarshalling it
GetFlattenJSON()JsonDataReturns data format that contains the return value of GetReturnValuetoJSON() by unmarshalling it
FlattenRows()JsonDataReturns data format that contains the return value of Rows() by unmarshalling it