Attach Instagram Professional Accounts
http
POST https://services.leadconnectorhq.com/social-media-posting/oauth/{locationId}/instagram/accounts/{accountId}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. |
Path parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | Yes | w37swmmLbA02zgqKPpxITe2 | Account Account Id |
accountId | string | Yes | w37swmmLbA02zgqKPpxITe | Account Id |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
originId | string | No | 244405****11687 | |
name | string | No | JOHN_DEO | |
avatar | string | No | ||
pageId | string | Yes | 234234234242sd | |
companyId | string | No | sdfdsfdsfEWEsdfsdsW32dd | Company ID |
Responses
201 - Successful response
success(boolean, required): Success or Failure Example:TruestatusCode(number, required): Status Code Example:201message(string, required): Message Example:Added Instagram Accountresults(object): Requested Results
json
{
"success": true,
"statusCode": 201,
"message": "Added Instagram Account"
}400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/social-media-posting/oauth/YOUR_locationId/instagram/accounts/YOUR_accountId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"originId": "244405****11687",
"name": "JOHN_DEO",
"avatar": "string",
"pageId": "234234234242sd",
"companyId": "sdfdsfdsfEWEsdfsdsW32dd"
}'const response = await fetch('https://services.leadconnectorhq.com/social-media-posting/oauth/YOUR_locationId/instagram/accounts/YOUR_accountId', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"originId": "244405****11687", "name": "JOHN_DEO", "avatar": "string", "pageId": "234234234242sd", "companyId": "sdfdsfdsfEWEsdfsdsW32dd"}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/social-media-posting/oauth/YOUR_locationId/instagram/accounts/YOUR_accountId',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"originId": "244405****11687", "name": "JOHN_DEO", "avatar": "string", "pageId": "234234234242sd", "companyId": "sdfdsfdsfEWEsdfsdsW32dd"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/social-media-posting/oauth/YOUR_locationId/instagram/accounts/YOUR_accountId');
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({'originId': '244405****11687', 'name': 'JOHN_DEO', 'avatar': 'string', 'pageId': '234234234242sd', 'companyId': 'sdfdsfdsfEWEsdfsdsW32dd'}),
]);
$data = json_decode(curl_exec($ch), true);