# 프록시 메모 저장

`POST /account/api/v1/proxies/note`

## 권한 인증

`Authorization: Bearer YOUR_ARNPROXY_API_KEY`

`Accept: application/json`

필요한 권한: `proxy_management`

`Content-Type: application/json`

## 매개변수

| 이름 | 유형 | 필수 / 조건부 | 기본값 | 설명 |
|---|---|---|---|---|
| `proxy_id` (body) | integer | 필수 | — | 본인 활성 프록시 기록 ID, 1–2147483647. |
| `note` (body) | string | 필수 | — | 앞뒤 공백 제거 후 최대 500자이며 조회 응답의 저장 한도를 따릅니다. 빈 문자열로 지웁니다. |
| `expected_revision` (body) | string | 필수 | — | 해당 범위/설정 조회의 revision: 소문자 16진수 64자. |

## 요청 본문

YOUR_/FROM_을 해당 카탈로그, 견적 또는 범위의 값으로 바꾸세요. 예제의 동의 값은 false입니다. 실제 작업에 동의할 때만 승인하세요.

```json
{
  "proxy_id": "YOUR_PROXY_ID",
  "note": "My application",
  "expected_revision": "FROM_PROXY_NOTE_REVISION"
}
```

## 요청 예제

### curl

```curl
printf 'Authorization: Bearer %s\n' "$ARNPROXY_API_KEY" |
  curl --silent --show-error --header @- \
    --header 'Accept: application/json' \
    --connect-timeout 10 --max-time 30 \
    --request POST --header 'Content-Type: application/json' \
    --data-binary @request.json \
    'https://www.arnproxy.com/account/api/v1/proxies/note'
```

### python

```python
import os, requests

headers = {"Authorization": "Bearer " + os.environ["ARNPROXY_API_KEY"]}
import json
with open("request.json", encoding="utf-8") as f:
    payload = json.load(f)
response = requests.post(
    "https://www.arnproxy.com/account/api/v1/proxies/note",
    headers=headers, json=payload,
    timeout=(10, 30), allow_redirects=False
)
print(response.status_code, response.text)
# No automatic write retry.
```

### javascript

```javascript
const headers = { Authorization: `Bearer ${process.env.ARNPROXY_API_KEY}` };
const { readFile } = await import('node:fs/promises');
headers['Content-Type'] = 'application/json';
const body = await readFile('request.json', 'utf8');
const response = await fetch("https://www.arnproxy.com/account/api/v1/proxies/note", {
  method: 'POST', headers, redirect: 'error',
  signal: AbortSignal.timeout(30000), body
});
console.log(response.status, await response.text());
// A write timeout is ambiguous; query its saved operation.
```

### php

```php
<?php
$headers = ['Accept: application/json',
    'Authorization: Bearer '.getenv('ARNPROXY_API_KEY')];
$headers[] = 'Content-Type: application/json';
$ch = curl_init('https://www.arnproxy.com/account/api/v1/proxies/note');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_FOLLOWLOCATION => false,
    CURLOPT_SSL_VERIFYPEER => true, CURLOPT_SSL_VERIFYHOST => 2,
    CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => 30,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => file_get_contents('request.json'),
]);
$result = curl_exec($ch);
if ($result === false) {
    // Do not repeat a write; use the original operation key.
    throw new RuntimeException('Transport result unknown');
}
echo curl_getinfo($ch, CURLINFO_HTTP_CODE).PHP_EOL.$result;
curl_close($ch);
```

### go

```go
package main

import (
  "fmt"
  "io"
  "net/http"
  "os"
  "time"
)

func main() {
  client := &http.Client{Timeout: 30*time.Second,
    CheckRedirect: func(req *http.Request, via []*http.Request) error {
      return http.ErrUseLastResponse
    }}
  var body io.Reader
  file, err := os.Open("request.json"); if err != nil { panic(err) }
  defer file.Close(); body = file
  req, err := http.NewRequest("POST", "https://www.arnproxy.com/account/api/v1/proxies/note", body)
  if err != nil { panic(err) }
  req.Header.Set("Authorization", "Bearer "+os.Getenv("ARNPROXY_API_KEY"))
  req.Header.Set("Content-Type", "application/json")
  res, err := client.Do(req); if err != nil { panic(err) }
  defer res.Body.Close()
  data, err := io.ReadAll(res.Body); if err != nil { panic(err) }
  fmt.Println(res.StatusCode, string(data))
}
```

### csharp

```csharp
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

using var handler = new HttpClientHandler { AllowAutoRedirect = false };
using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(30) };
using var request = new HttpRequestMessage(HttpMethod.Post,
    "https://www.arnproxy.com/account/api/v1/proxies/note");
request.Headers.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("ARNPROXY_API_KEY"));
request.Content = new StringContent(
    await File.ReadAllTextAsync("request.json"), Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
// Never automatically retry an ambiguous write.
```

### java

```java
import java.net.URI;
import java.net.http.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.*;

// Inside your application method:
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create("https://www.arnproxy.com/account/api/v1/proxies/note"))
    .header("Authorization", "Bearer " + System.getenv("ARNPROXY_API_KEY"))
    .header("Accept", "application/json")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(
        Files.readString(Path.of("request.json"), StandardCharsets.UTF_8)))
    .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
```

## 응답 · HTTP 200

```json
{
  "ok": true,
  "data": {
    "state": "completed",
    "changed": true,
    "provider_requests": 0,
    "proxy_id": 12345,
    "note": "Example label",
    "revision": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "note_update_available": true,
    "clear_with_empty_string": true,
    "source": "arnproxy_records",
    "maximum_length": 500,
    "maximum_utf8_bytes": 2000,
    "full_unicode_supported": true
  },
  "meta": {
    "request_id": "000000000000000000000001",
    "phase": "public_v1",
    "source": "arnproxy_records"
  }
}
```

| 이름 | 유형 | 조건부 | 설명 |
|---|---|---|---|
| `ok` | boolean | — | 성공 여부. false이면 error.code를 확인하세요. |
| `data` | object | — | 작업별 결과이며 예제는 설명용 합성 데이터입니다. |
| `data.state` | string | — | 기록/작업 상태. accepted는 배송 완료가 아니며 completed는 연결 테스트가 아닙니다. |
| `data.changed` | boolean | — | 메모가 실제 변경되었는지 여부. 같은 내용이 이미 있으면 false일 수 있습니다. |
| `data.provider_requests` | integer | — | provider requests의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.proxy_id` | integer | — | 관련 ARNPROXY 기록 ID. 공급자 내부 ID 대신 사용하세요. |
| `data.note` | string | — | note의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.revision` | string | — | 해당 변경/가격 확인에 그대로 반환할 최신성 식별자입니다. |
| `data.note_update_available` | boolean | — | note update available의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.clear_with_empty_string` | boolean | — | clear with empty string의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.source` | string | — | 데이터 출처. 로컬 기록과 실시간 공급자 조회는 서로 다른 근거입니다. |
| `data.maximum_length` | integer | — | maximum length의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.maximum_utf8_bytes` | integer | — | maximum utf8 bytes의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `data.full_unicode_supported` | boolean | — | full unicode supported의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `meta` | object | — | 요청 추적 및 데이터 출처 메타데이터. |
| `meta.request_id` | string | — | 이 HTTP 요청의 추적 ID이며 작업 키나 주문 ID가 아닙니다. |
| `meta.phase` | string | — | phase의 작업별 값입니다. 반환된 유형을 유지하고 동작 설명을 확인하세요. |
| `meta.source` | string | — | 데이터 출처. 로컬 기록과 실시간 공급자 조회는 서로 다른 근거입니다. |

## 동작 및 주요 참고 사항

- 고객 패널의 기존 프록시 메모를 사용하며 공급자에게 보내지 않습니다. GET 저장 한도 내 최대 500자입니다. note=""로 지우고 proxy_note에서 revision을 먼저 읽으세요. 같은 값은 changed:false이며 오래된 revision은 다른 내용을 덮어쓰지 못합니다. Idempotency-Key는 불필요하며 결과가 불확실하면 다시 읽으세요.

인증 및 검증 단계에서 실행 전에 요청이 거부될 수 있습니다. 오류 문서를 확인하고 지원 문의용 request_id를 보관하세요. 키나 비밀번호를 보내지 마세요.

[오류 및 제한](https://docs.arnproxy.com/ko/api-v1/errors)
