<?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$curl = curl_init();curl_setopt_array($curl, [ CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'DELETE', 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.Threading.Tasks;class Program{ static async Task Main(string[] args) { using var client = new HttpClient(); var requestUri = "https://api.ayrshare.com/api/profiles"; var bearerToken = "Bearer API_KEY"; var profileKey = "PROFILE_KEY"; using var request = new HttpRequestMessage(HttpMethod.Delete, requestUri); request.Headers.Add("Authorization", bearerToken); request.Headers.Add("Profile-Key", profileKey); try { using var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine($"Error: {e.Message}"); } }}
<?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$curl = curl_init();curl_setopt_array($curl, [ CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'DELETE', 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.Threading.Tasks;class Program{ static async Task Main(string[] args) { using var client = new HttpClient(); var requestUri = "https://api.ayrshare.com/api/profiles"; var bearerToken = "Bearer API_KEY"; var profileKey = "PROFILE_KEY"; using var request = new HttpRequestMessage(HttpMethod.Delete, requestUri); request.Headers.Add("Authorization", bearerToken); request.Headers.Add("Profile-Key", profileKey); try { using var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine($"Error: {e.Message}"); } }}
{ "action": "post", "status": "error", "code": 144, "message": "Some profiles not found. Please verify the Profile Keys."}
刪除你所擁有的 User Profile。標頭參數中的 Profile Key 即為要刪除的 User Profile。
刪除 User Profile 會永久移除該 Profile 及所有相關聯的貼文——此操作無法還原。你每秒最多可刪除 8 個 User Profile,執行大量刪除時請將 API 呼叫錯開,以避免超過速率限制。
每個月的計費週期是以該週期內任一天達到的 User Profile 最高數量計費,且不會低於你的方案所含的最低數量——在最低數量時刪除 User Profile 並不會降低費用。這個最高紀錄只會上升,不會下降:刪除 User Profile 可以避免之後的日子把它推得更高,但無法把該週期已經達到的數字降下來,因此在達到最高紀錄之後,省下的費用要到下一個計費週期才會反映。這不適用於價格固定的 Launch 方案,也不適用於客製化或 Enterprise 合約,後者以合約本身的條款為準。若要查看每日的 User Profile 數量,請呼叫 取得 User Profiles 並將 actionLog 設為 true。
<?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$curl = curl_init();curl_setopt_array($curl, [ CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => 'DELETE', 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.Threading.Tasks;class Program{ static async Task Main(string[] args) { using var client = new HttpClient(); var requestUri = "https://api.ayrshare.com/api/profiles"; var bearerToken = "Bearer API_KEY"; var profileKey = "PROFILE_KEY"; using var request = new HttpRequestMessage(HttpMethod.Delete, requestUri); request.Headers.Add("Authorization", bearerToken); request.Headers.Add("Profile-Key", profileKey); try { using var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); var responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine($"Error: {e.Message}"); } }}