Create Business
http
POST https://services.leadconnectorhq.com/businesses/Authorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
name | string | Yes | Microsoft | |
locationId | string | Yes | 5DP4iH6HLkQsiKESj6rh | |
phone | string | No | +18832327657 | |
email | string | No | john@deo.com | |
website | string | No | www.xyz.com | |
address | string | No | street adress | |
city | string | No | new york | |
postalCode | string | No | 12312312 | |
state | string | No | new york | |
country | string | No | us | |
description | string | No | business description |
Responses
201 - Successful response
success(boolean, required): Success Value Example:Truebuiseness(object, required): Business Response
json
{
"success": true
}400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/businesses/' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"name": "Microsoft",
"locationId": "5DP4iH6HLkQsiKESj6rh",
"phone": "+18832327657",
"email": "john@deo.com",
"website": "www.xyz.com",
"address": "street adress",
"city": "new york",
"postalCode": "12312312",
"state": "new york",
"country": "us",
"description": "business description"
}'const response = await fetch('https://services.leadconnectorhq.com/businesses/', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"name": "Microsoft", "locationId": "5DP4iH6HLkQsiKESj6rh", "phone": "+18832327657", "email": "john@deo.com", "website": "www.xyz.com", "address": "street adress", "city": "new york", "postalCode": "12312312", "state": "new york", "country": "us", "description": "business description"}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/businesses/',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"name": "Microsoft", "locationId": "5DP4iH6HLkQsiKESj6rh", "phone": "+18832327657", "email": "john@deo.com", "website": "www.xyz.com", "address": "street adress", "city": "new york", "postalCode": "12312312", "state": "new york", "country": "us", "description": "business description"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/businesses/');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'name': 'Microsoft', 'locationId': '5DP4iH6HLkQsiKESj6rh', 'phone': '+18832327657', 'email': 'john@deo.com', 'website': 'www.xyz.com', 'address': 'street adress', 'city': 'new york', 'postalCode': '12312312', 'state': 'new york', 'country': 'us', 'description': 'business description'}),
]);
$data = json_decode(curl_exec($ch), true);