Skip to main content
LINE友だち更新
curl --request PATCH \
  --url https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "display_name": "<string>",
  "is_test_account": true,
  "is_exclusion": true
}
'
import requests

url = "https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id}"

payload = {
"display_name": "<string>",
"is_test_account": True,
"is_exclusion": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({display_name: '<string>', is_test_account: true, is_exclusion: true})
};

fetch('https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'display_name' => '<string>',
'is_test_account' => true,
'is_exclusion' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id}"

payload := strings.NewReader("{\n \"display_name\": \"<string>\",\n \"is_test_account\": true,\n \"is_exclusion\": true\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"<string>\",\n \"is_test_account\": true,\n \"is_exclusion\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"display_name\": \"<string>\",\n \"is_test_account\": true,\n \"is_exclusion\": true\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "<string>",
    "common_friend_id": "<string>",
    "common_reader_id": "<string>",
    "display_name": "<string>",
    "picture_url": "<string>",
    "is_blocked": true,
    "is_test_account": true,
    "is_exclusion": true,
    "response_status": {
      "text": "<string>",
      "color": "<string>"
    },
    "labels": [
      {
        "id": "<string>",
        "name": "<string>"
      }
    ],
    "common_fields": {},
    "memo": "<string>",
    "message_tracking_name": "<string>",
    "last_acted_at": "<string>",
    "created_at": "<string>"
  }
}
{
"error": {
"code": "unauthorized",
"message": "認証に失敗しました"
}
}
{
"error": {
"code": "not_found",
"message": "リソースが見つかりません"
}
}
{
"error": {
"code": "validation_error",
"message": "バリデーションエラーが発生しました"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "リクエスト上限を超えました。しばらく時間を空けて再試行してください"
}
}
PATCH
https://api.utage-system.com/v1/accounts/{account_id}/line/friends/{friend_id}
この機能はプレビュー版です。仕様が変更される場合があります。

Authorizations

Authorization
string
header
required

APIキーをBearerトークンとして指定

Path Parameters

account_id
string
required

アカウントID

friend_id
string
required

LINE友だちID

Body

application/json
display_name
string

表示名

Maximum string length: 20
is_test_account
boolean

テスト対象フラグ

is_exclusion
boolean

配信除外フラグ

Response

更新されたLINE友だち詳細

data
object