🌐
Recrubo API
  • Getting Started
    • Introduction
    • Sandbox
    • Async requests
    • Authentication
    • Webhooks
    • Filtering, sorting, pagination and including resources
  • Guides
    • Setting up webhooks
    • Generating flows
    • Editing flows
    • Triggering flows
    • Embedding the Inbox
    • Sending messages
  • Resources
    • API Resource Reference
      • Candidate
      • Conversation
      • Flow
      • FlowRun
      • FlowGeneration
      • Message
      • MessageTemplate
      • MessageThread
      • NodeAction
      • NodeTransition
      • Node
      • VacancyAnalysis
      • Vacancy
      • User
      • WebhookPayload
    • Embeddables
      • Inbox
      • BotStudio
      • GenerateFlow
      • Whatsapp connect button
      • Schedule Form
      • Schedule Table
    • Flow types
      • vacancy_application_flow
  • Management
    • Organizations
Powered by GitBook
On this page
  1. Resources
  2. API Resource Reference

MessageTemplate

PreviousMessageNextMessageThread

Last updated 11 months ago

MessageTemplate is a resource that represents a template for a message that can be sent to a candidate. It can be used in the initial message of a . Or as a standalone message. MessageTemplates are a proxy of .

This means it is a requirement to have a WhatsApp Business Account/number connected to the platform to create these messages. However, the MessageTemplate can be used to send messages to any channel, not just WhatsApp.

Currently it is not possible to update a MessageTemplate after it has been created.

Endpoints

  • GET /message-templates - Retrieve a list of all MessageTemplates.

  • GET /message-templates/{id} - Retrieve a specific MessageTemplate by ID.

  • POST /message-templates - Create a new MessageTemplate.

  • DELETE /message-templates/{id} - Delete a specific MessageTemplate by ID.

Attributes

Field
Type
Description

name

String

The name of the message template. This is displayed in the message payload.

components

Array

language

String

The language of the message template. This is used by Meta while validating the message template.

category

String

The category of the message template. This can be Marketing, Utility or Authorization.

status

String

preview

String

The preview text of the message template.

createdAt

DateTime

The timestamp when the message template was created.

updatedAt

DateTime

The timestamp when the message template was last updated.

Components

Field
Type
Description

text

String

The text content of the component.

type

String

The type of the component. Can be HEADER, BODY, or FOOTER.

format

String

The format of the component, only required for the header.

example

JSON object

The example usage of the component. Only required when using variables.

We only support text format for the components at this moment

At this time the header and footer components are not supported in the web preview, but they will work on other channels.

Example POST body

{
  "data": {
    "type": "messageTemplates",
    "attributes": {
      "name": "start_application",
      "components": [
        {
          "text":"Recrubo application!",
          "type": "HEADER",
          "format": "Text"

        },
        {
          "text": "Hi {{1}}, great to see you want to work with us! Reply to this message to schedule your interview.",
          "type": "BODY",
          "example": {
            "body_text": [
              [
                "John"
              ]
            ]
          }
        },
        {
          "text": "Team Recrubo",
          "type": "FOOTER"
        }
      ],
      "language": "en",
      "category": "MARKETING",
      "preview": "Hi {{1}}, great to see you want to work with us! Reply to this message to schedule your interview."
    }
  }
}

Validation errors

Validation is done by The WhatsApp servers at Meta, we will pass the validation errors back to you in the response.

Example validation error response

{
  "errors": [
    {
      "code": "bad_request",
      "status": 400,
      "title": "Bad Request",
      "detail": {
        "message": "Invalid parameter",
        "type": "OAuthException",
        "code": 100,
        "error_subcode": 2388024,
        "is_transient": false,
        "error_user_title": "Content in this language already exists",
        "error_user_msg": "There is already English content for this template. You can create a new template and try again.",
        "fbtrace_id": "AeodpEogjjeg5cgl43HljgP"
      }
    }
  ]
}

OpenAPI

See

The of the message template.

See for more information on the components.

FlowRun
WhatsApp templates
Components
status
Components

Retrieve a single message_template

get
Authorizations
Path parameters
idstringRequired
Responses
200
message_template found
application/vnd.api+json
401
access denied
404
MessageTemplate not found
get
GET /public/v2/message-templates/{id} HTTP/1.1
Host: {defaulthost}
Authorization: YOUR_API_KEY
Accept: */*
{
  "data": {
    "id": "1b38de11-5735-487f-9de4-10c500c37e3e",
    "type": "messageTemplates",
    "attributes": {
      "createdAt": "2024-08-20T10:45:08+00:00",
      "updatedAt": "2024-08-20T10:45:08+00:00",
      "name": "contact_request",
      "components": [
        {
          "text": "Hi {{1}}, enige tijd geleden heb je bij Blokker gesolliciteerd. Heb je nog steeds interesse in de vacature? Klik op ja/nee knop hieronder, indien jouw antwoord ja is nemen we contact met je op. Gr. Team Blokker",
          "type": "BODY"
        }
      ],
      "language": "nl",
      "category": "TRANSACTIONAL",
      "status": "approved",
      "preview": "Hey! Wat leuk dat je interesse hebt in een baan bij Blokker. 😁 \n \nAntwoord met start om de sollicitatie te starten."
    },
    "relationships": {
      "user": {
        "links": {
          "related": null
        }
      }
    }
  },
  "meta": {}
}

Retrieve all MessageTemplates

get
Authorizations
Responses
200
message_templates found
application/vnd.api+json
401
access denied
get
GET /public/v2/message-templates HTTP/1.1
Host: {defaulthost}
Authorization: YOUR_API_KEY
Accept: */*
{
  "data": [
    {
      "id": "760063d0-f554-4dcd-af0f-bfc763a640d0",
      "type": "messageTemplates",
      "attributes": {
        "createdAt": "2024-08-20T10:45:08+00:00",
        "updatedAt": "2024-08-20T10:45:08+00:00",
        "name": "contact_request",
        "components": [
          {
            "text": "Hi {{1}}, enige tijd geleden heb je bij Blokker gesolliciteerd. Heb je nog steeds interesse in de vacature? Klik op ja/nee knop hieronder, indien jouw antwoord ja is nemen we contact met je op. Gr. Team Blokker",
            "type": "BODY"
          }
        ],
        "language": "nl",
        "category": "TRANSACTIONAL",
        "status": "approved",
        "preview": "Hey! Wat leuk dat je interesse hebt in een baan bij Blokker. 😁 \n \nAntwoord met start om de sollicitatie te starten."
      },
      "relationships": {
        "user": {
          "links": {
            "related": null
          }
        }
      }
    },
    {
      "id": "cb5bb820-6d28-4624-9796-91456a249c4a",
      "type": "messageTemplates",
      "attributes": {
        "createdAt": "2024-08-20T10:45:08+00:00",
        "updatedAt": "2024-08-20T10:45:08+00:00",
        "name": "contact_request",
        "components": [
          {
            "text": "Hi {{1}}, enige tijd geleden heb je bij Blokker gesolliciteerd. Heb je nog steeds interesse in de vacature? Klik op ja/nee knop hieronder, indien jouw antwoord ja is nemen we contact met je op. Gr. Team Blokker",
            "type": "BODY"
          }
        ],
        "language": "nl",
        "category": "TRANSACTIONAL",
        "status": "approved",
        "preview": "Hey! Wat leuk dat je interesse hebt in een baan bij Blokker. 😁 \n \nAntwoord met start om de sollicitatie te starten."
      },
      "relationships": {
        "user": {
          "links": {
            "related": null
          }
        }
      }
    },
    {
      "id": "2fd7c499-0ba2-48ff-a60e-c0ade0f603e4",
      "type": "messageTemplates",
      "attributes": {
        "createdAt": "2024-08-20T10:45:08+00:00",
        "updatedAt": "2024-08-20T10:45:08+00:00",
        "name": "contact_request",
        "components": [
          {
            "text": "Hi {{1}}, enige tijd geleden heb je bij Blokker gesolliciteerd. Heb je nog steeds interesse in de vacature? Klik op ja/nee knop hieronder, indien jouw antwoord ja is nemen we contact met je op. Gr. Team Blokker",
            "type": "BODY"
          }
        ],
        "language": "nl",
        "category": "TRANSACTIONAL",
        "status": "approved",
        "preview": "Hey! Wat leuk dat je interesse hebt in een baan bij Blokker. 😁 \n \nAntwoord met start om de sollicitatie te starten."
      },
      "relationships": {
        "user": {
          "links": {
            "related": null
          }
        }
      }
    }
  ],
  "meta": {
    "total": 3,
    "totalUnfiltered": 3,
    "currentSize": 25,
    "currentPage": 1,
    "maxPage": 1
  }
}

Destroy a Candidate

delete
Authorizations
Path parameters
idstringRequired
Responses
204
candidate destroyed
401
access denied
404
Candidate not found
delete
DELETE /public/v2/candidates/{id} HTTP/1.1
Host: {defaulthost}
Authorization: YOUR_API_KEY
Accept: */*

No content

Destroy a MessageTemplate

delete
Authorizations
Path parameters
idstringRequired
Responses
204
message_template destroyed
401
access denied
404
MessageTemplate not found
delete
DELETE /public/v2/message-templates/{id} HTTP/1.1
Host: {defaulthost}
Authorization: YOUR_API_KEY
Accept: */*

No content

  • Endpoints
  • Attributes
  • Components
  • Example POST body
  • Validation errors
  • Example validation error response
  • OpenAPI
  • POSTCreate a MessageTemplate
  • GETRetrieve a single message_template
  • GETRetrieve all MessageTemplates
  • DELETEDestroy a Candidate
  • DELETEDestroy a MessageTemplate

Create a MessageTemplate

post
Authorizations
Body
Responses
201
message_template created
application/vnd.api+json
400
Bad Request
401
access denied
post
POST /public/v2/message-templates HTTP/1.1
Host: {defaulthost}
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 137

{
  "data": {
    "id": "text",
    "type": "text",
    "attributes": {
      "name": "text",
      "components": [],
      "language": "en",
      "category": "Marketing",
      "preview": "text"
    }
  }
}
{
  "data": {
    "id": "e28a0e38-1b2f-4cc2-82e8-b49101ea2df4",
    "type": "messageTemplates",
    "attributes": {
      "createdAt": "2024-08-20T10:45:08+00:00",
      "updatedAt": "2024-08-20T10:45:08+00:00",
      "name": "contact_request",
      "components": [
        {
          "text": "Hi {{1}}, enige tijd geleden heb je bij Blokker gesolliciteerd. Heb je nog steeds interesse in de vacature? Klik op ja/nee knop hieronder, indien jouw antwoord ja is nemen we contact met je op. Gr. Team Blokker",
          "type": "BODY"
        }
      ],
      "language": "nl",
      "category": "some_category",
      "status": "some_status",
      "preview": "Hi {{1}}, enige tijd geleden heb je bij Blokker gesolliciteerd. Heb je nog steeds interesse in de vacature? Klik op ja/nee knop hieronder, indien jouw antwoord ja is nemen we contact met je op. Gr. Team Blokker"
    },
    "relationships": {
      "user": {
        "links": {
          "related": null
        }
      }
    }
  },
  "meta": {}
}