http
POST https://services.leadconnectorhq.com/social-media-posting/{locationId}/set-accountsAuthorization
| 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 | ve9EPM428h8vShlRW1KT | Account Id |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
accountIds | string[] | Yes | Account Ids | |
filePath | string | Yes | o6241QsiRwUIJHyjuhos/social-planner-import/a6d04a26-0401-4e52-8f48-dbb274050fab.csv | File path |
rowsCount | number | Yes | 1 | Entires Count. rowcCount must be between 1 and number of posts in CSV |
fileName | string | Yes | test.csv | Name of file |
approver | string | No | o6241QsiRwUIJHyjuhos | |
userId | string | No | sdfdsfdsfEWEsdfsdsW32dd | User ID |
Responses
201 - Successful response
success(boolean, required): Success or Failure Example:TruestatusCode(number, required): Status Code Example:201message(string, required): Message Example:Accounts Set Successfully
json
{
"success": true,
"statusCode": 201,
"message": "Accounts Set Successfully"
}400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/set-accounts' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"accountIds": [
"aF3KhyL8JIuBwzK3m7Ly_iVrVJ2uoXNF0wzcBzgl5_12554616564525983496"
],
"filePath": "o6241QsiRwUIJHyjuhos/social-planner-import/a6d04a26-0401-4e52-8f48-dbb274050fab.csv",
"rowsCount": 1,
"fileName": "test.csv",
"approver": "o6241QsiRwUIJHyjuhos",
"userId": "sdfdsfdsfEWEsdfsdsW32dd"
}'const response = await fetch('https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/set-accounts', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"accountIds": ["aF3KhyL8JIuBwzK3m7Ly_iVrVJ2uoXNF0wzcBzgl5_12554616564525983496"], "filePath": "o6241QsiRwUIJHyjuhos/social-planner-import/a6d04a26-0401-4e52-8f48-dbb274050fab.csv", "rowsCount": 1, "fileName": "test.csv", "approver": "o6241QsiRwUIJHyjuhos", "userId": "sdfdsfdsfEWEsdfsdsW32dd"}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/set-accounts',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"accountIds": ["aF3KhyL8JIuBwzK3m7Ly_iVrVJ2uoXNF0wzcBzgl5_12554616564525983496"], "filePath": "o6241QsiRwUIJHyjuhos/social-planner-import/a6d04a26-0401-4e52-8f48-dbb274050fab.csv", "rowsCount": 1, "fileName": "test.csv", "approver": "o6241QsiRwUIJHyjuhos", "userId": "sdfdsfdsfEWEsdfsdsW32dd"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/set-accounts');
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({'accountIds': ['aF3KhyL8JIuBwzK3m7Ly_iVrVJ2uoXNF0wzcBzgl5_12554616564525983496'], 'filePath': 'o6241QsiRwUIJHyjuhos/social-planner-import/a6d04a26-0401-4e52-8f48-dbb274050fab.csv', 'rowsCount': 1, 'fileName': 'test.csv', 'approver': 'o6241QsiRwUIJHyjuhos', 'userId': 'sdfdsfdsfEWEsdfsdsW32dd'}),
]);
$data = json_decode(curl_exec($ch), true);