GET

Get Message Template by Type & Locale

Early Preview

This API is in early preview and may be subject to change. Please contact your account manager if you are interested in trying the Branding API.

Use this API to retrieve a single message template by its type and language locale.

Resource URL

https://<subdomain>.onelogin.com/api/2/branding/brands/:brand_id/templates/:template_type/:locale

Header Parameters

Authorization

required

string

Set to bearer <access_token>.

Set <access_token> to the access token you generated using the Generate Token API.

The access token must have been generated using an API credential pair created using the scope required to call this API. This API can be called using any one of the following scopes: Manage All.

In order to use the Branding API your API Credentials must be created after 21st October 2020.

Content-Type

required

string

Set to application/json.

Resource Parameters

brand_id

required

integer

Unique identifier for the branding object.

template_type

required

string

The message template type to return.

locale

required

string

The 2 character language locale for the template.

Sample Responses

{
    "id": 544880,
    "account_id": 118462,
    "locale": "en",
    "type": "email_code_app_verification",
    "template_class": "email_template",
    "template": {
        "subject": "Email MFA App Verification Code",
        "html": "<html><head></head><body><p>Here is the code: &lcub;&lcub;otp_code&rcub;&rcub;</p></body></html>",
        "plain": "Here is the code: {{otp_code}}"
    },
    "updated_at": "2021-11-24T21:25:29.480Z",
    "brand_id": 5
}
{
    "name": "UnauthorizedError",
    "message": "The request requires user authentication."
}
{
    "name": "NotFoundError",
    "message": "Unknown Content Template type: \"544880\"",
    "statusCode": 404
}

Postman Collection

Replace sample variables indicated by {{ }} with your actual values.

Run In Postman

    Clicking Run in Postman button navigates to the page where you can fork the collection to your workspace. Forking the collection into your workspace will enable you to contribute to the source collection using pull requests. You can also view the collection in a public workspace if you like and even import a copy of the collection using the links present on the screen.

Sample Code

cURL

Replace sample values indicated by < > with your actual values.

Get Account Brand

curl 'https://<subdomain>.onelogin.com/api/2/branding/brands/:id/templates/:template_type/:locale' \
-X GET \
-H "Authorization: bearer <access_token>"
-H "Content-Type: application/json" \