Functions API
Overview of functions API methods
post
https://api.codemash.io
/:version/serverless/functions/:id/execute
Execute Function
.NET
Node
PHP
1
var client = new CodeMashClient(apiKey, projectId);
2
var codeService = new CodeMashCodeService(client);
3
4
var response = await codeService.ExecuteFunctionAsync(new ExecuteFunctionRequest
5
{
6
Id = Guid.Parse("{FUNCTION_ID}"),
7
});
Copied!
1
Copied!
1
use Codemash\CodemashClient;
2
use Codemash\CodemashCode;
3
4
class CodemashService
5
{
6
protected CodemashCode $codemashCode;
7
8
public function __construct()
9
{
10
$secretKey = '{YOUR_SECRET_KEY}';
11
$projectId = '{YOUR_PROJECT_ID}';
12
13
$client = new CodemashClient($secretKey, $projectId);
14
$this->codemashCode = new CodemashAuth($client);
15
}
16
17
public function executeFunction()
18
{
19
$responseData = $this->codemashCode->executeFunction([
20
'id' => '{YOUR_FUNCTION_ID}',
21
]);
22
}
23
}
Copied!
In order to execute the function method, you can use GET method instead of POST.
Copy link