Code
Serverless code for your project. Write code in any language you have experience with or choose from dozens of pre-written built-in functions.
Using SDK
var projectId = Guid.Parse("{YOUR_PROJECT_ID}");
var apiKey = "{YOUR_SECRET_KEY}";
var client = new CodeMashClient(apiKey, projectId);
var codeService = new CodeMashCodeService(client);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);
}
}Example
using System;
using CodeMash.Client;
using CodeMash.Code.Services;
using Isidos.CodeMash.ServiceContracts;
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
// 1. Get your Project ID and Secret Key
var projectId = Guid.Parse("{YOUR_PROJECT_ID}");
var apiKey = "{YOUR_SECRET_KEY}";
// 2. Create a general client for API calls
var client = new CodeMashClient(apiKey, projectId);
// 3. Create a service object
var codeService = new CodeMashCodeService(client);
// 4. Call an API method
codeService.ExecuteFunction(new ExecuteFunctionRequest
{
Id = Guid.Parse("{YOUR_FUNCTION_ID}")
});
}
}
}Working with Code Service
IntegrationsFunctionsCodeMash FunctionsLast updated