BeelineNet.LeadGenerator
0.1.0
See the version list below for details.
dotnet add package BeelineNet.LeadGenerator --version 0.1.0
NuGet\Install-Package BeelineNet.LeadGenerator -Version 0.1.0
<PackageReference Include="BeelineNet.LeadGenerator" Version="0.1.0" />
<PackageVersion Include="BeelineNet.LeadGenerator" Version="0.1.0" />
<PackageReference Include="BeelineNet.LeadGenerator" />
paket add BeelineNet.LeadGenerator --version 0.1.0
#r "nuget: BeelineNet.LeadGenerator, 0.1.0"
#:package BeelineNet.LeadGenerator@0.1.0
#addin nuget:?package=BeelineNet.LeadGenerator&version=0.1.0
#tool nuget:?package=BeelineNet.LeadGenerator&version=0.1.0
<table> <tr> <td width="150" align="center" valign="middle"> <img src="https://raw.githubusercontent.com/ai-iskuzhin/BeelineNet.LeadGenerator/main/assets/logo.png" width="120" alt="BeelineNet.LeadGenerator logo" /> </td> <td valign="middle"> <h1>BeelineNet.LeadGenerator</h1> <p>A System.Text.Json-native .NET client for the <b>beeline B2B Lead Generator</b> partner API — submit leads as a beeline advertising agent, search/poll their status, read the product catalogue, and upload product template files.</p> <p> <a href="https://www.nuget.org/packages/BeelineNet.LeadGenerator"><img src="https://img.shields.io/nuget/v/BeelineNet.LeadGenerator?logo=nuget&style=flat-square" alt="NuGet" /></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License" /></a> <img src="https://img.shields.io/badge/target-net8.0-512BD4?logo=dotnet&style=flat-square" alt="Target" /> </p> </td> </tr> </table>
The client covers the partner surface (/external/*): create a lead, search leads, list products, and
upload a product template. Built from Beeline's partner API spec (PDF v1.1.9 + OpenAPI 3.0.1), which is
proprietary and not redistributed here. Part of the BeelineNet SDK family.
Authentication — mutual TLS
The partner gateway authenticates with a client certificate (mTLS), not an API key or token. During
onboarding you generate a private key + CSR and receive a signed certificate; the endpoint is also
IP-allowlisted to the server whose IP you declared — calls only succeed from that host. A bare
.crt (public certificate) cannot authenticate; you need the certificate and its private key.
# smoke test from the allowlisted server:
curl -v --cert ./client_crt.pem --key ./client_key.pem \
https://api-partner.beeline.ru/leadgenerator-lead-api/v1/external/offers
Installation
dotnet add package BeelineNet.LeadGenerator
Quick start (dependency injection)
using BeelineNet.LeadGenerator;
using Microsoft.Extensions.DependencyInjection;
services.AddBeelineLeadGenerator(o =>
{
o.ClientCertificate = BeelineCertificate.FromPemFiles("client_crt.pem", "client_key.pem");
o.AgreementNumber = "ПМ999999"; // your partner agreement — used as the default on every call
});
Then inject IBeelineLeadGeneratorClient:
using BeelineNet.LeadGenerator.Models;
using BeelineNet.LeadGenerator.Requests;
public sealed class LeadForwarder(IBeelineLeadGeneratorClient beeline)
{
public async Task<string> ForwardAsync(string phone, CancellationToken ct)
{
var lead = await beeline.CreateLeadAsync(new CreateLeadRequest
{
Offers = ["143"], // product ids from GetOffersAsync
Contact = new Contact("Иванов Василий", BeelineFormats.NormalizePhone(phone)),
Inn = "7727563778",
Comment = "Interested via our B2B ad",
}, ct);
return lead.Id; // lead.LifecycleStatus.Id → LeadStatuses.NewLead, etc.
}
}
Standalone (no DI)
using var client = BeelineLeadGeneratorClient.Create(new BeelineClientOptions
{
ClientCertificate = BeelineCertificate.FromPfx("partner.pfx", "password"),
AgreementNumber = "ПМ999999",
});
var offers = await client.GetOffersAsync();
API surface
| Method | Endpoint | Purpose |
|---|---|---|
CreateLeadAsync |
POST /external/leads |
Submit a lead |
SearchLeadsAsync |
POST /external/leads/search |
Search leads / poll status (paged) |
GetOffersAsync |
GET /external/offers |
Product catalogue |
UploadOfferAttachmentAsync |
POST /external/offers/{id}/attachment |
Upload a product template file (v1.1.9+) |
- Statuses are an open string set — compare
lead.LifecycleStatus.IdagainstLeadStatuses.*(NewLead,Processed,Rejected,Success, …). The API has been seen returning ids outside its own documented list (e.g."NEW CASE"), so unknown values are preserved, not rejected. - Product connection type is
ConnectionTypes.Mobile/ConnectionTypes.Fixed(string constants). - Formats:
Contact.Phonemust be 10 national digits — useBeelineFormats.NormalizePhone;Innis 10 or 12 digits — check withBeelineFormats.IsValidInn.
Errors
Non-success responses throw BeelineApiException with StatusCode, the parsed Error
(ErrorCode, TraceId, …), and the raw ResponseBody. Quote TraceId to support (beelego@beeline.ru).
Partner onboarding status
Verified against production from the whitelisted server on 2026-08-27:
- mTLS works — the client certificate authenticates. The client must present the full chain
(leaf +
Vimpelcom InternalCA G3); leaf-only is rejected withunknown ca. Load viaBeelineCertificate.FromPfx(...)so the chain is sent. - Subscription pending — all three live endpoints return
403900908("API Subscription validation failed"). The certificate is recognised but not yet subscribed to the Lead API on Beeline's gateway; this is a Beeline-side activation step (contactbeelego@beeline.ru). - Attachment endpoint not deployed — the gateway runs the OpenAPI v1.1.0 surface (3 paths);
POST /external/offers/{id}/attachment(PDF v1.1.9) returns404until Beeline upgrades. - The endpoint is IP-allowlisted to the server declared at onboarding — calls only work from there.
License
MIT — see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.