Create Opt-ins (Subscribers) using Landbot API

Ana Updated by Ana

In this article, we will configure the HTTP request needed to make subscribers for your WhatsApp.

  1. Go to the Get opt-ins section of your WhatsApp channel.

  1. Generate an opt-in snippet by clicking on "Configure a new snippet".

  1. Once you click on "Configure a new snippet", you'll find a few options to customize it. You can choose, optionally, if after generating the subscriber you want to send a template. And also optionally, a bot to be launched. Consider that the bot will be launched automatically only after the first user input.

Once you've made those decisions, press Create Snippet button.

  1. After the snippet is created, an URL field is populated. Copy the URL.

  1. Use that URL to make a POST request that will create the subscriber for a WhatsApp number.
curl --location --request POST 'https://messages.landbot.io/wa/W-1196-TCODZM8SIJ5CP1ZE/opt_in?phone=XXXXXXXXX' \
--header 'Authorization: Token XXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
--header 'Content-Type: application/json'

Replace the phone value with a valid number and get your API Token from the Settings section of the app.

  1. Optionally, you can add parameters to the URL. For example, in the case of tracking purposes you add a source param that includes the origin of your leads:
https://messages.landbot.io/wa/W-1196-TCODZM8SIJ5CP1ZE/opt_in?phone=XXXXXXXXX&source=facebookleads

How did we do?

Audiences

New Opt-in block for WhatsApp 🚀

Contact