Skip to main content
Version: 5.11.8

InvokeFunction

public BackendReturnObject InvokeFunction(string funcName, Param body);

Parameters

ValueTypeDescription
funcNamestringMethod name to be called
bodyParamData to be passed as the parameter value of the method

Description

Executes the BACKND Function deployed in the server.

Example

Synchronous

Param param = new Param();
param.Add("value", "HelloWorld");

Backend.BFunc.InvokeFunction("funcName", param);

Asynchronous

Param param = new Param();
param.Add("value", "HelloWorld");

Backend.BFunc.InvokeFunction("funcName", param, (callback) =>
{
// Post-process
});

SendQueue

Param param = new Param();
param.Add("value", "HelloWorld");

SendQueue.Enqueue(Backend.BFunc.InvokeFunction, "funcName", param, (callback) =>
{
// Post-process
});

Return casess

Success cases

When the method is called successfully
statusCode : 200
errorCode : Success returnValue : { result: {''} }

When the method is called successfully but an error occurs in BACKND Function It will be returned as a success even if an error occurs in BACKND Function.
The developer must process success/failure in BACKND Function separately by processing the returnValue again.

statusCode : 200
errorCode : Success returnValue : { result: {''} }

Error cases

When a Korean character is included in the method name
statusCode : 400
errorCode : BadParameterException

When an incorrect BACKND Function authorization key is entered in Unity
statusCode : 401
errorCode : BadUnauthorizedException

When a non-existent method name is called
statusCode : 404
errorCode : ResourceNotFoundException