Reactor API에서 참고는 특정 리소스에 추가할 수 있는 텍스트 주석입니다. 메모는 본질적으로 각 리소스에 대한 주석입니다. 참고의 내용은 리소스 동작에 영향을 주지 않으며, 다음을 포함한 다양한 사용 사례에 사용할 수 있습니다.
다음 /notes
reactor API의 종단점을 사용하면 이러한 메모를 프로그래밍 방식으로 관리할 수 있습니다.
참고는 다음 리소스를 적용할 수 있습니다.
이 여섯 가지 유형들은 전체적으로 "주목할 만한" 자원이라고 알려져 있습니다. 주목할 만한 리소스가 삭제되면 관련 참고 사항도 삭제됩니다.
여러 개의 개정을 사용할 수 있는 리소스의 경우 현재 (head) 수정 버전에 모든 메모를 만들어야 합니다. 다른 수정 버전에 첨부되지 않을 수 있습니다.
그러나 참고 사항은 여전히 개정 버전에서 읽힐 수 있습니다. 이러한 경우 API는 개정을 만들기 전에 존재했던 참고만 반환합니다. 수정 사항이 삭제되었을 때 주석에 대한 스냅샷을 제공합니다. 반면에 현재(헤드) 개정에서 노트를 읽으면 해당 메모가 모두 반환됩니다.
이 안내서에 사용된 엔드포인트는 Reactor API. 계속하기 전에 시작 안내서 를 참조하십시오.
리소스에 대한 메모 목록을 추가하여 검색할 수 있습니다 /notes
해당 리소스에 대한 GET 요청 경로로 전송됩니다.
API 형식
GET /{RESOURCE_TYPE}/{RESOURCE_ID}/notes
매개 변수 | 설명 |
---|---|
RESOURCE_TYPE |
메모를 가져오는 리소스 유형입니다. 다음 값 중 하나여야 합니다.
|
RESOURCE_ID |
다음 id 노트를 나열할 특정 리소스의 특정 리소스 수입니다. |
요청
다음 요청에는 라이브러리에 첨부된 참고가 나열됩니다.
curl -X GET \
https://reactor.adobe.io/libraries/LBcffea1a38c52408cae2398868625a12d/notes \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H "Content-Type: application/vnd.api+json" \
-H 'Accept: application/vnd.api+json;revision=1'
응답
성공적인 응답은 지정된 리소스에 첨부된 참고 목록을 반환합니다.
{
"data": [
{
"id": "NTa40de8d76bfd4e40835830900ce83b7b",
"type": "notes",
"attributes": {
"author_display_name": "John Smith",
"author_email": "jsmith@example.com",
"created_at": "2020-12-14T17:51:00.411Z",
"text": "this is a note on a library"
},
"relationships": {
"resource": {
"links": {
"related": "https://reactor.adobe.io/libraries/LBcffea1a38c52408cae2398868625a12d"
},
"data": {
"id": "LBcffea1a38c52408cae2398868625a12d",
"type": "libraries"
}
}
},
"links": {
"resource": "https://reactor.adobe.io/libraries/LBcffea1a38c52408cae2398868625a12d",
"self": "https://reactor.adobe.io/notes/NTa40de8d76bfd4e40835830900ce83b7b"
}
}
],
"meta": {
"pagination": {
"current_page": 1,
"next_page": null,
"prev_page": null,
"total_pages": 1,
"total_count": 1
}
}
}
GET 요청 경로에 해당 ID를 제공하여 메모를 조회할 수 있습니다.
API 형식
GET /notes/{NOTE_ID}
매개 변수 | 설명 |
---|---|
NOTE_ID |
다음 id 조회하려는 메모의 |
요청
curl -X GET \
https://reactor.adobe.io/notes/NT550b7a17ab304d49ba289a2978d673e5 \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H "Content-Type: application/vnd.api+json" \
-H 'Accept: application/vnd.api+json;revision=1'
응답
성공적인 응답은 참고의 세부 사항을 반환합니다.
{
"data": {
"id": "NT550b7a17ab304d49ba289a2978d673e5",
"type": "notes",
"attributes": {
"author_display_name": "John Smith",
"author_email": "jsmith@example.com",
"created_at": "2020-12-14T17:51:10.316Z",
"text": "this is a note on a property"
},
"relationships": {
"resource": {
"links": {
"related": "https://reactor.adobe.io/properties/PR4537ac6f1f204ffd864ec47c4b27c2e8"
},
"data": {
"id": "PR4537ac6f1f204ffd864ec47c4b27c2e8",
"type": "properties"
}
}
},
"links": {
"resource": "https://reactor.adobe.io/properties/PR4537ac6f1f204ffd864ec47c4b27c2e8",
"self": "https://reactor.adobe.io/notes/NT550b7a17ab304d49ba289a2978d673e5"
}
}
}
새 메모를 만들려면 먼저 메모를 편집할 수 없으며 해당 리소스를 삭제하는 방법만 기억하십시오.
를 추가하여 새 메모를 만들 수 있습니다 /notes
해당 리소스에 대한 POST 요청 경로로 전송됩니다.
API 형식
POST /{RESOURCE_TYPE}/{RESOURCE_ID}/notes
매개 변수 | 설명 |
---|---|
RESOURCE_TYPE |
메모를 만드는 리소스 유형입니다. 다음 값 중 하나여야 합니다.
|
RESOURCE_ID |
다음 id 메모를 만들 특정 리소스의 세부 자산입니다. |
요청
다음 요청은 속성에 대한 새 메모를 만듭니다.
curl -X POST \
https://reactor.adobe.io/properties/PRb25a704c0b7c4562835ccdf96d3afd31/notes \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'x-api-key: {API_KEY}' \
-H 'x-gw-ims-org-id: {ORG_ID}' \
-H 'Content-Type: application/json' \
-d '{
"data": {
"type": "notes",
"attributes": {
"text": "this is a note on a property"
}
}
}'
속성 | 설명 |
---|---|
type |
(필수) 업데이트할 리소스 유형입니다. 이 끝점의 경우 값은 notes . |
attributes.text |
(필수) 메모를 포함하는 텍스트입니다. 각 메모는 512개의 유니코드 문자로 제한됩니다. |
응답
성공적으로 응답하면 새로 만든 참고의 세부 정보가 반환됩니다.
{
"data": {
"id": "NT550b7a17ab304d49ba289a2978d673e5",
"type": "notes",
"attributes": {
"author_display_name": "John Smith",
"author_email": "jsmith@example.com",
"created_at": "2020-12-14T17:51:10.316Z",
"text": "This is a note on a property"
},
"relationships": {
"resource": {
"links": {
"related": "https://reactor.adobe.io/properties/PR4537ac6f1f204ffd864ec47c4b27c2e8"
},
"data": {
"id": "PR4537ac6f1f204ffd864ec47c4b27c2e8",
"type": "properties"
}
}
},
"links": {
"resource": "https://reactor.adobe.io/properties/PR4537ac6f1f204ffd864ec47c4b27c2e8",
"self": "https://reactor.adobe.io/notes/NT550b7a17ab304d49ba289a2978d673e5"
}
}
}