Skip to main content
Version: SDK-5.11.2

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
message : bad functionName, Invalid functionName

When an incorrect BACKND Function authorization key is entered in Unity
statusCode : 401
errorCode : BadUnauthorizedException
message : 'bad BackendFunctionToken, Invalid BackendFunctionToken'

When a non-existent method name is called
statusCode : 404
errorCode : ResourceNotFoundException
message : Function not found: "name of the called method"