Skip to content

Referral System in a MAX Bot

How to create a bot with a referral program

The referral system for working with a MAX bot is fully identical to the referral system for a Telegram bot.

Referral system in a Telegram bot

The LEADTEX referral system in a MAX bot lets you work with unlimited structure depth in real time: get links, view referrals by level, count them, and find referrers with tag filtering.

Key methods:

  • {{ getInviteLink() }} — contact's referral link with the LEADTEX domain.
  • {{ getDirectInviteLink() }} — direct bot referral link without the LEADTEX domain.
  • {{ getReferrals(limit, "tagName") }} — list of 1st-level referrals (up to 100), with an optional tag.
  • {{ getReferralsCount("tagName") }} — total number of referrals in the contact's entire network; returns a number.
  • {{ getReferrer(depth) }} — contact's current referrer; optionally specify the level in the referral network depth (default 1 — direct referrer).
  • {{ getLinkBySchema(id) }} — link to the specified scenario.
  • {{ getInviteLinkWithSchema(id) }} — referral link to an additional scenario (created automatically if it has not been created yet).
  • {{ getReferralsByDepth(depth, limit, "tagName") }} — list of referrals at the specified depth level below the current contact (depth = 1 — first line). Optionally filters by tag.
  • {{ getReferralsCountByDepth(depth, "tagName") }} — number of referrals at the selected depth level.
  • {{ getReferrers(limit, offset, "tagName") }} — list of referrers up the chain with level and tag filtering.

where: - depth — level (line) in the referral network relative to the current contact. 1 — first line (direct referrals / direct referrer), 2 — second line, etc. Minimum: 1. - offset — which level up the referrer chain to start output from (1 = direct referrer, 2 = referrer's referrer). - limit — number of records in the output. Default 10, valid range: 1 to 100 (values outside the range are clamped to the boundaries) - tag — tag on the user

To get information about your contact's referrals and referrers, you can also use the referral system API:

Referral system (API)

Bonus for new users: get 500 rubles in credits as a gift 🎁

  • Sign up on LEADTEX
  • Create and test your first project
  • Don't miss the special offer. Get your gift 👈