Tablighgram Leads API – HackMD
tags: Documentation

Tablighgram Leads API

Required instructions and notes to work with Tablighgram Leads API.

HTTP Status Codes

Code Text Description
200 OK Success!
400 Bad Request The request was invalid or cannot be otherwise served. An accompanying error code and message will explain further.
403 Unauthorized Missing or incorrect authentication credentials.
404 Not Found The requested resource could not be found. An accompanying error message will explain further.
500 Internal Server Error A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
{ "Content-Type": "application/x-www-form-urlencoded", }

Submit lead

URL: https://i.tablighdrive.com/drive/v2/leads/create
Headers: {Global Header}
Method POST
Body:

{ token : STRING - "REQUIRED", project_id : STRING - "REQUIRED", label : STRING - "REQUIRED", ref : STRING, content_id : STRING, {variable_name} : {variable_content} - "REQUIRED", {variable_name} : {variable_content}, ... }

Output: 200

{ success: [ { message: STRING - "REQUIRED", } ] }

Output: 400
When there are errors
Example:

{ errors: [ { key: STRING - "REQUIRED", message: STRING - "REQUIRED", }, ] }

Import Note :

1)At least one variable is required in each request.

2)Label could be any string like project name or project id. changing of label’s value is not required in each request.

3)For taking token and project_id contact technical support or operation team.

Example code (Curl) :

curl --location --request POST 'http://i.tablighdrive.com/drive/v2/leads/create' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'token=YOURTOKEN' \ --data-urlencode 'project_id=144' \ --data-urlencode 'label=test_144' \ --data-urlencode 'نام=نیما' \ --data-urlencode 'فامیل=برزگر' \ --data-urlencode 'سن=۲۱'