MeiroDocs

WhatsApp

Required feature: **settings/channels**

Section: Group WhatsApp. Base URL: https://instance_name.meiro.io/api/.

WhatsApp Business Account Templates [/channels/whatsapp/accounts/{account_id}/templates]

Load WhatsApp business account templates [GET]

Required feature: settings/channels

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (array[TemplateWithPositionalParams])
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (array[TemplateWithNamedParams])
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (array[TemplateWithAlternativeHeaderAndButton])
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (array[TemplateWithCopyCodeButton])
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (array[TemplateWithFlowButton])
  • Response 404 (application/json)

{
    "message": "WhatsApp account with id 'account_id' not found"
}

WhatsApp Campaigns [/whatsapp_campaigns]

Retrieve WhatsApp campaigns [GET]

Required feature (one of):

  • whatsapp/view

  • whatsapp/edit

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (array[WhatsappCampaignWithPositionalTemplateParameters])
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (array[WhatsappCampaignWithNamedTemplateParameters])
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (array[WhatsappCampaignWithMediaHeaderTemplateParameters])
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (array[WhatsappCampaignWithCopyCodeButtonTemplateParameters])

Create WhatsApp campaign [POST]

Required feature: whatsapp/edit

  • Attributes (WhatsappCampaignCreate)

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 201 (application/json)

    • Attributes (WhatsappCampaignWithPositionalTemplateParameters)
  • Response 404 (application/json)

{
    "message": "WhatsApp account with id 'a_id' not found"
}
  • Response 404 (application/json)
{
    "message": "Template 'temp A' not found under account 'a_id'"
}
  • Response 400 (application/json)
{
    "message": "Template component 'body' has positional parameters, but they are not defined in content"
}
  • Response 400 (application/json)
{
    "message": ""Whatsapp campaign with name 'Campaign A' already exists"
}

WhatsApp Campaign [/whatsapp_campaigns/{campaign_id}]

Retrieve WhatsApp campaign [GET]

Required feature (one of):

  • whatsapp/view

  • whatsapp/edit

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (WhatsappCampaignWithPositionalTemplateParameters)
  • Response 404 (application/json)

{
    "message": "Whatsapp campaign not found"
}

Modify WhatsApp campaign content [PATCH]

Required feature: whatsapp/edit

  • Attributes (WhatsappCampaignModify)

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (WhatsappCampaignWithPositionalTemplateParameters)
  • Response 404 (application/json)

{
    "message": "Whatsapp campaign not found"
}
  • Response 404 (application/json)
{
    "message": "WhatsApp account with id 'a_id' not found"
}
  • Response 404 (application/json)
{
    "message": "Template 'temp A' not found under account 'a_id'"
}
  • Response 400 (application/json)
{
    "message": "Template component 'body' has positional parameters, but they are not defined in content"
}
  • Response 400 (application/json)
{
    "message": ""Whatsapp campaign with name 'Campaign A' already exists"
}

WhatsApp Campaigns Activation Settings [/whatsapp_campaigns/activation/settings/{campaign_id}]

Modify WhatsApp campaign activation settings [PUT]

Required feature: whatsapp/edit

  • Attributes (WhatsappCampaignModifyActivationSettings)

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (WhatsappCampaignWithPositionalTemplateParameters)
  • Response 404 (application/json)

{
    "message": "Whatsapp campaign not found"
}
  • Response 404 (application/json)
{
    "message": "WhatsApp account with id 'a_id' not found"
}
  • Response 404 (application/json)
{
    "message": "Template 'temp A' not found under account 'a_id'"
}
  • Response 400 (application/json)
{
    "message": "Template component 'body' has positional parameters, but they are not defined in content"
}
  • Response 400 (application/json)
{
    "message": "The campaign frequency cap cannot be less strict than the global frequency cap (max_count 5 per 2 hours period)"
}

Whatsapp Campaign Trash [/whatsapp_campaigns/trash/{campaign_id}]

Restore Trashed Whatsapp Campaign [PATCH]

Required feature: whatsapp/edit

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

    • Attributes (WhatsappCampaignWithPositionalTemplateParameters)
  • Response 404 (application/json)

{
    "message": "Whatsapp campaign not found"
}
  • Response 404 (application/json)
{
    "message": "WhatsApp account with id 'a_id' not found"
}
  • Response 404 (application/json)
{
    "message": "Template 'temp A' not found under account 'a_id'"
}
  • Response 404 (application/json)
{
    "message": "Whatsapp business account with id 'a_id' not found between channel's registered accounts"
}
  • Response 400 (application/json)
{
    "message": "Template component 'body' has positional parameters, but they are not defined in content"
}
  • Response 400 (application/json)
{
    "message": "Templates fetch for account 'a_id'failed"
}

Delete Whatsapp Campaign [DELETE]

Required feature: whatsapp/edit

  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "message": "ok"
}
  • Response 404 (application/json)
{
    "message": "Whatsapp campaign not found"
}
  • Response 400 (application/json)
{
    "message": "The campaign is used in the following journey(s):",
    "error_type": "whatsapp_campaign_used_in_journey",
    "journeys": [{"id": "journey_id", "name": "Journey Name"}]
}

Whatsapp Campaigns Trash [/whatsapp_campaigns/trash/{?limit,offset,searched_text}]

Get Deleted Whatsapp Campaigns [GET]

Required feature: whatsapp/view

  • Parameters

    • limit (number, optional) - Limit of the number of records returned
    • offset (number, optional) - Offset for the number of records returned
    • searched_text (string, optional) - Searched items' name
  • Request (application/json)

    • Headers

      X-Access-Token: 1234567890abcdef

  • Response 200 (application/json)

{
    "selection_settings": {
        "limit": 20,
        "offset": 0,
        "searched_text": null
    },
    "trashed_whatsapp": [
          {
              "id": "campaign_id",
              "name": "Campaign A",
              "account": {
                "id": "account_id",
                "name": "Account A"
              },
              "content": {
                "template": {
                  "name": "Template",
                  "status": "accepted",
                  "header": null,
                  "body": {
                    "type": "body",
                    "text": "Hello",
                    "positional_parameters_count": 0,
                    "named_parameters": []
                  },
                  "footer": null,
                  "buttons": []
                },
                "parameters": {
                  "header": null,
                  "body": null,
                  "buttons": []
                }
              },
              "modified": "2024-02-12T12:49:09Z",
              "modified_by": 2,
              "deleted": true,
              "schedules": [],
              "last_activation": "2024-02-12T12:49:09Z",
              "last_activation_by": 42,
              "consistency_status": "consistent"
        }
    ]
}

On this page