全ユーザーの一括取得
curl --request GET \
--url https://api.ayrshare.com/api/user/batch \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ayrshare.com/api/user/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ayrshare.com/api/user/batch"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/user/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ayrshare.com/api/user/batch"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ayrshare.com/api/user/batch")
.header("Authorization", "Bearer <token>")
.asString();{
"success": true,
"url": "https://storage.googleapis.com/batch.ayrshare.com/users/9iskiedwtOddd/users-batch-2024-01-11-22-42.json",
"urlAvailable": "2024-01-11T22:47:36Z",
"urlExpires": "2024-01-18T22:42:36Z",
"lastUpdated": "2024-01-11T22:42:36.808Z",
"nextUpdate": "2024-01-11T22:54:36.808Z"
}
{
"action": "authorization",
"status": "error",
"code": 102,
"message": "API Key not valid. Please be sure to send a Header Authorization containing 'Bearer API_KEY'. .../ayrshare.com/rest-api/overview#authorization"
}
User
全ユーザーの一括取得
すべてのユーザープロフィールのユーザーデータを取得
GET
/
user
/
batch
全ユーザーの一括取得
curl --request GET \
--url https://api.ayrshare.com/api/user/batch \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ayrshare.com/api/user/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ayrshare.com/api/user/batch"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/user/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ayrshare.com/api/user/batch"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ayrshare.com/api/user/batch")
.header("Authorization", "Bearer <token>")
.asString();{
"success": true,
"url": "https://storage.googleapis.com/batch.ayrshare.com/users/9iskiedwtOddd/users-batch-2024-01-11-22-42.json",
"urlAvailable": "2024-01-11T22:47:36Z",
"urlExpires": "2024-01-18T22:42:36Z",
"lastUpdated": "2024-01-11T22:42:36.808Z",
"nextUpdate": "2024-01-11T22:54:36.808Z"
}
{
"action": "authorization",
"status": "error",
"code": 102,
"message": "API Key not valid. Please be sure to send a Header Authorization containing 'Bearer API_KEY'. .../ayrshare.com/rest-api/overview#authorization"
}
すべてのユーザープロフィールのユーザーデータを取得します。/userエンドポイントを各ユーザーに対して連続的に呼び出す代わりに、バッチエンドポイントを使用してください。連続呼び出しはレート制限により制限される場合があります。
このエンドポイントは、すべてのユーザープロフィールデータを含むファイルへの署名済みURLを返します。ファイルにアクセス可能になる時刻については、
urlAvailableフィールドを確認してください。
署名済みURLは作成から7日後に期限切れになります。新しいファイルは3時間ごとに生成されます。
ファイルの準備ができたときにBatchアクションのwebhook経由で通知を受け取ることもできます。
ヘッダーパラメータ
{
"success": true,
"url": "https://storage.googleapis.com/batch.ayrshare.com/users/9iskiedwtOddd/users-batch-2024-01-11-22-42.json",
"urlAvailable": "2024-01-11T22:47:36Z",
"urlExpires": "2024-01-18T22:42:36Z",
"lastUpdated": "2024-01-11T22:42:36.808Z",
"nextUpdate": "2024-01-11T22:54:36.808Z"
}
{
"action": "authorization",
"status": "error",
"code": 102,
"message": "API Key not valid. Please be sure to send a Header Authorization containing 'Bearer API_KEY'. .../ayrshare.com/rest-api/overview#authorization"
}
⌘I
