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
Cập nhật User Profile
Cập nhật một profile hiện có.
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."
}
Cập nhật tiêu đề, ẩn tiêu đề, danh sách các nền tảng xã hội bị vô hiệu hóa, hoặc hiển thị tiêu đề của một profile hiện có.
Profile Key trong tham số header là User Profile sẽ được cập nhật.
Tham số Header
Tham số Body
Mảng các mạng xã hội bị vô hiệu hóa cho profile của người dùng này. Danh sách các mạng xã hội bị vô hiệu hóa của primary profile được ưu tiên.Các mạng có sẵn:
bluesky, facebook, gmb, instagram, linkedin, pinterest, reddit, snapchat, telegram, threads, tiktok, twitter, và youtube.Xem tại đây để biết thêm thông tin.Tiêu đề của profile. Phải là duy nhất. Tiêu đề này sẽ được hiển thị trên trang liên kết social account.
Đặt thành true để kích hoạt nhắn tin cho user profile này. Nhắn tin phải được bật trước cho tài khoản Ayrshare của bạn.
Ẩn tiêu đề trên cùng trên trang liên kết social accounts.
Ẩn logo công ty trên trang liên kết social accounts chỉ dành cho user profile này. Logo toàn tài khoản trên các profile khác không bị ảnh hưởng. Hữu ích để white-label các profile đối tác riêng lẻ mà vẫn giữ thương hiệu trên các profile còn lại.
Thay đổi tiêu đề trên trang liên kết social accounts. Nếu không đặt, sẽ hiển thị: “Social Accounts for “title” trong đó “title” là tiêu đề profile.
Gắn thẻ user profile bằng cách sử dụng một mảng các chuỗi. Các thẻ này đóng vai trò là công cụ tổ chức nội bộ để phân loại và quản lý các user profile của bạn hiệu quả.
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
