Skip to content

Latest commit

 

History

History
67 lines (46 loc) · 3.91 KB

File metadata and controls

67 lines (46 loc) · 3.91 KB

EmailAndSmsTemplates

Warning

This SDK is DEPRECATED

Overview

Available Operations

  • upsert - Update a template for a given type and slug ⚠️ Deprecated

upsert

Updates the existing template of the given type and slug

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.ClerkErrors;
import com.clerk.backend_api.models.operations.UpsertTemplatePathParamTemplateType;
import com.clerk.backend_api.models.operations.UpsertTemplateResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ClerkErrors, Exception {

        Clerk sdk = Clerk.builder()
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        UpsertTemplateResponse res = sdk.emailAndSmsTemplates().upsert()
                .templateType(UpsertTemplatePathParamTemplateType.EMAIL)
                .slug("<value>")
                .call();

        if (res.template().isPresent()) {
            System.out.println(res.template().get());
        }
    }
}

Parameters

Parameter Type Required Description
templateType UpsertTemplatePathParamTemplateType ✔️ The type of template to update
slug String ✔️ The slug of the template to update
requestBody Optional<UpsertTemplateRequestBody> N/A

Response

UpsertTemplateResponse

Errors

Error Type Status Code Content Type
models/errors/ClerkErrors 400, 401, 402, 403, 404, 422 application/json
models/errors/SDKError 4XX, 5XX */*