curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"profileKey": "Jokdf-903Js-j9sd0-Pow02-QS9n3", "title": "ACME Profile"}' \
-X PATCH https://api.ayrshare.com/api/profiles
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/profiles", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
"Profile-Key": "PROFILE_KEY";
},
body: JSON.stringify({
title: "ACME Profile"
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'title': 'ACME Profile'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY',
'Profile-Key': 'PROFILE_KEY'}
r = requests.patch('https://api.ayrshare.com/api/profiles',
json=payload,
headers=headers)
print(r.json())
<?php
$url = 'https://api.ayrshare.com/api/profiles';
$apiKey = 'API_KEY'; // Replace with your actual API key
$profileKey = 'PROFILE_KEY'; // Replace with your actual Profile key
$data = ['title' => 'ACME Profile']; // Your data to be sent
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
'Profile-Key: ' . $profileKey
],
]);
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo 'Error:' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace UpdateProfilePOSTRequest_csharp
{
class UpdateProfile
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string PROFILE_KEY = "PROFILE_KEY"; // Make sure this is defined
string url = "https://api.ayrshare.com/api/profiles";
string json = "{\"title\": \"ACME Profile\"}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
client.DefaultRequestHeaders.Add("Profile-Key", PROFILE_KEY);
try
{
var content = new StringContent(json, Encoding.UTF8, "application/json");
var request = new HttpRequestMessage
{
Method = new HttpMethod("PATCH"),
RequestUri = new Uri(url),
Content = content
};
HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
}
{
"status": "success",
"refId": "b1eb30ce50607a40000b220c01c20a88a49fe76f"
}
{
"action": "post",
"status": "error",
"code": 144,
"message": "Some profiles not found. Please verify the Profile Keys."
}
Profiles
更新 User Profile
更新已有的 profile。
PATCH
/
profiles
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"profileKey": "Jokdf-903Js-j9sd0-Pow02-QS9n3", "title": "ACME Profile"}' \
-X PATCH https://api.ayrshare.com/api/profiles
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/profiles", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
"Profile-Key": "PROFILE_KEY";
},
body: JSON.stringify({
title: "ACME Profile"
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'title': 'ACME Profile'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY',
'Profile-Key': 'PROFILE_KEY'}
r = requests.patch('https://api.ayrshare.com/api/profiles',
json=payload,
headers=headers)
print(r.json())
<?php
$url = 'https://api.ayrshare.com/api/profiles';
$apiKey = 'API_KEY'; // Replace with your actual API key
$profileKey = 'PROFILE_KEY'; // Replace with your actual Profile key
$data = ['title' => 'ACME Profile']; // Your data to be sent
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
'Profile-Key: ' . $profileKey
],
]);
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo 'Error:' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace UpdateProfilePOSTRequest_csharp
{
class UpdateProfile
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string PROFILE_KEY = "PROFILE_KEY"; // Make sure this is defined
string url = "https://api.ayrshare.com/api/profiles";
string json = "{\"title\": \"ACME Profile\"}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
client.DefaultRequestHeaders.Add("Profile-Key", PROFILE_KEY);
try
{
var content = new StringContent(json, Encoding.UTF8, "application/json");
var request = new HttpRequestMessage
{
Method = new HttpMethod("PATCH"),
RequestUri = new Uri(url),
Content = content
};
HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
}
{
"status": "success",
"refId": "b1eb30ce50607a40000b220c01c20a88a49fe76f"
}
{
"action": "post",
"status": "error",
"code": 144,
"message": "Some profiles not found. Please verify the Profile Keys."
}
更新已有 profile 的 title、是否隐藏 title、已禁用的社交平台列表,或显示 title。
header 参数中的 Profile Key 即为要更新的 User Profile。
Header 参数
Body 参数
为该 user profile 禁用的社交网络数组。Primary Profile 中的禁用社交网络列表优先生效。可用网络:
bluesky、facebook、gmb、instagram、linkedin、pinterest、reddit、snapchat、telegram、threads、tiktok、twitter 和 youtube。更多信息请参阅此处。profile 的标题。必须唯一。该标题将显示在社交账户关联页面上。
设为 true 可为该 user profile 启用私信 (DM) 功能。必须先在你的 Ayrshare 账户中启用私信功能。
在社交账户关联页面上隐藏顶部标题栏。
仅在该 user profile 的社交账户关联页面上隐藏公司 logo。其他 profile 上的账户级 logo 不受影响。适用于对特定合作伙伴 profile 进行白标处理,同时保留其余 profile 的品牌标识。
更改社交账户关联页面上的标题栏。若未设置,则显示:“Social Accounts for “title"",其中 “title” 为 profile 的标题。
使用字符串数组为 user profile 添加标签。这些标签是用于对 user profile 进行有效分类与管理的内部组织工具。
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"profileKey": "Jokdf-903Js-j9sd0-Pow02-QS9n3", "title": "ACME Profile"}' \
-X PATCH https://api.ayrshare.com/api/profiles
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/profiles", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
"Profile-Key": "PROFILE_KEY";
},
body: JSON.stringify({
title: "ACME Profile"
}),
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
payload = {'title': 'ACME Profile'}
headers = {'Content-Type': 'application/json',
'Authorization': 'Bearer API_KEY',
'Profile-Key': 'PROFILE_KEY'}
r = requests.patch('https://api.ayrshare.com/api/profiles',
json=payload,
headers=headers)
print(r.json())
<?php
$url = 'https://api.ayrshare.com/api/profiles';
$apiKey = 'API_KEY'; // Replace with your actual API key
$profileKey = 'PROFILE_KEY'; // Replace with your actual Profile key
$data = ['title' => 'ACME Profile']; // Your data to be sent
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer ' . $apiKey,
'Profile-Key: ' . $profileKey
],
]);
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo 'Error:' . curl_error($curl);
} else {
echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
}
curl_close($curl);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace UpdateProfilePOSTRequest_csharp
{
class UpdateProfile
{
static async Task Main(string[] args)
{
string API_KEY = "API_KEY";
string PROFILE_KEY = "PROFILE_KEY"; // Make sure this is defined
string url = "https://api.ayrshare.com/api/profiles";
string json = "{\"title\": \"ACME Profile\"}";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
client.DefaultRequestHeaders.Add("Profile-Key", PROFILE_KEY);
try
{
var content = new StringContent(json, Encoding.UTF8, "application/json");
var request = new HttpRequestMessage
{
Method = new HttpMethod("PATCH"),
RequestUri = new Uri(url),
Content = content
};
HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Error: {e.Message}");
}
}
}
}
}
{
"status": "success",
"refId": "b1eb30ce50607a40000b220c01c20a88a49fe76f"
}
{
"action": "post",
"status": "error",
"code": 144,
"message": "Some profiles not found. Please verify the Profile Keys."
}
⌘I
