Code
Overview of functions API methods
post
https://api.codemash.io
/:version/serverless/functions/:id/execute
Execute Function
.NET
Node
PHP
var client = new CodeMashClient(apiKey, projectId);
var codeService = new CodeMashCodeService(client);
var response = await codeService.ExecuteFunctionAsync(new ExecuteFunctionRequest
{
Id = Guid.Parse("{FUNCTION_ID}"),
});
use Codemash\CodemashClient;
use Codemash\CodemashCode;
class CodemashService
{
protected CodemashCode $codemashCode;
public function __construct()
{
$secretKey = '{YOUR_SECRET_KEY}';
$projectId = '{YOUR_PROJECT_ID}';
$client = new CodemashClient($secretKey, $projectId);
$this->codemashCode = new CodemashAuth($client);
}
public function executeFunction()
{
$responseData = $this->codemashCode->executeFunction([
'id' => '{YOUR_FUNCTION_ID}',
]);
}
}
In order to execute the function method, you can use GET method instead of POST.
Copy link