declare(strict_types=1);
require 'vendor/autoload.php';
use novu;
use novu\Models\Operations;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$requestBody = new Operations\TranslationControllerUploadMasterJsonEndpointRequestBody(
file: new Operations\File(
fileName: 'example.file',
content: file_get_contents('example.file');,
),
);
$response = $sdk->translations->master->upload(
requestBody: $requestBody
);
if ($response->importMasterJsonResponseDto !== null) {
// handle response
}
from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.translations.master.upload(request_body={
"file": {
"file_name": "example.file",
"content": open("example.file", "rb"),
},
})
# Handle response
print(res)
package main
import(
"context"
"github.com/novuhq/novu-go/v3"
"os"
"github.com/novuhq/novu-go/v3/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := v3.New(
v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
)
example, fileErr := os.Open("example.file")
if fileErr != nil {
panic(fileErr)
}
res, err := s.Translations.Master.Upload(ctx, operations.TranslationControllerUploadMasterJSONEndpointRequestBody{
File: operations.File{
FileName: "example.file",
Content: example,
},
}, nil)
if err != nil {
log.Fatal(err)
}
if res.ImportMasterJSONResponseDto != nil {
// handle response
}
}
import { Novu } from "@novu/api";
import { openAsBlob } from "node:fs";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.translations.master.upload({
file: await openAsBlob("example.file"),
});
console.log(result);
}
run();
using Novu;
using Novu.Models.Components;
using Novu.Models.Requests;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
var res = await sdk.Translations.Master.UploadAsync(requestBody: new TranslationControllerUploadMasterJsonEndpointRequestBody() {
File = new Novu.Models.Requests.File() {
FileName = "example.file",
Content = System.IO.File.ReadAllBytes("example.file"),
},
});
// handle response