Adding Leads via API

This article covers examples of how to add leads via PHP, cURL

James Dodd avatar
Written by James Dodd
Updated over a week ago

Please Note: this section is intended with users with a high degree of technical knowledge and experience in back end development.

Get Your Integration Document

Before we begin in you'll need to have an integration document to hand for the campaign you will be working with.

Open the HTTP POST tab, which is the cogs icon.

And you should have something like this.

This document (in addition to this guide) covers everything you need to submit leads into the Databowl instance.

Quick Tips:

The following come up fairly frequently, so please ensure they are observed:

Request Type:

Databowl will only work with HTTP POST.

If you are attempting to use GET and are experiencing issues, please change to GET.

Server Side:

Databowl will only work server side code, we do not allow front end code to work with the system as it could expose the end points to the general public and risk fraudulent data being submitted to your instance.

Understanding the Data:

Whatever language or system you are using, the following information is always required:

End point/URL

This is listed at the top of the doc. In this instance, it's listed as follows, tho yours will differ:



Requires a value of application/x-www-form-urlencoded


This should be a calculation of the payload, if you're unable to do this, please do not include this.


This is the address of your databowl instance. Submitting may work OK without this, but if you require it, then the integration doc will show you something like this:

So is the value you'd need


The integration doc covers each field, whether it's required, as well as formats that the data needs to follow. Ensure this is observed to avoid errors.

Add each data you need.

The cid and sid are static values, they will be the same for each campaign and supplier that you are working with. Please enter them in as shown in the doc.

In this example, we're using, the following, but yours will differ

cid: 100 and sid: 200

PHP - cURL - Example

The following example should be updated with your own variables and fields/data being inputted.


$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_POSTFIELDS => 'cid=100&sid=200&optin_email=true&optin_phone=true&optin_postal=true&',
'Content-Type: application/x-www-form-urlencoded',

$response = curl_exec($curl);

echo $response;

cURL - Example

The following example should be updated with your own variables and fields/data being inputted.

curl --location --request POST '' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--form 'cid="100"' \
--form 'sid="200"' \
--form 'optin_email="true"' \
--form 'optin_phone="true"' \
--form 'optin_postal="true"' \
--form 'f_1_email=""' \
--form 'f_3_firstname="Dave"' \
--form 'f_4_lastname="Testerson"'

Python - Requests - Example

The following example should be updated with your own variables and fields/data being inputted.

import requests

url = ""

payload={'cid': '100',
'sid': '200',
'optin_email': 'true',
'optin_phone': 'true',
'optin_postal': 'true',
'f_1_email': '',
'f_3_firstname': 'Dave',
'f_4_lastname': 'Testerson'}

headers = {
'Content-Type': 'application/x-www-form-urlencoded',

response = requests.request("POST", url, headers=headers, data=payload, files=files)


C# - RestSharp - Example

The following example should be updated with your own variables and fields/data being inputted.

var client = new RestClient("");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AlwaysMultipartFormData = true;
request.AddParameter("cid", "100");
request.AddParameter("sid", "200");
request.AddParameter("optin_email", "true");
request.AddParameter("optin_phone", "true");
request.AddParameter("optin_postal", "true");
request.AddParameter("f_1_email", "");
request.AddParameter("f_3_firstname", "Dave");
request.AddParameter("f_4_lastname", "Testerson");
IRestResponse response = client.Execute(request);


Once you've run a test, you should receive a JSON object back like this:

"result": "created",
"lead_id": "934"

result: created

This means the lead is in databowl

lead_id: 930

and this is your lead id, you can now head in to the instance and search 930 to find your lead.

If you've got an Error

If you're not seeing this, adjust your configuration following the integration document closely.

Our integration document explains lots of different error messages, it's just lower on the page and should look like this... so scroll down on there and have a read.

πŸš€ Need More assistance?

If you're stuck or if this isn't something you or your team is comfortable with, then please open a new chat/ticket (chat icon in the bottom right of the screen) or email

We're here to assist with any questions you have, and if required we can quote on actioning work like this for as part of our Marketing Services.

Did this answer your question?