2016-10-27 5 views
4

"업데이트보기"끝점에 대한 설명서를 볼 때 사용 가능한 정보가 거의 없습니다 (https://developers.podio.com/doc/views/update-view-20069949 참조). 현재 문서에서는 endpoint가 하나의 매개 변수 인 view_id를 허용하지만 API 사용자는 뷰의 정의를 수정하기 위해 추가 세부 정보를 제공 할 수 있기를 원합니다.보기를 업데이트하는 Podio API 끝점은 어떻게 작동합니까?

이 끝점의 사용 방법을 보여줄 수있는 예제 코드가 있습니까?

답변

5

Podio Ruby 클라이언트는이 엔드 포인트를 사용하는 코드를 제공합니다. here을 보면 새로운 뷰의 정의를 지정하는 PUT에 JSON 본문이 제공 될 것으로 예상됩니다. Ruby 코드에서는 "속성"이라고하며 다른 뷰 작업에 대한 API 설명서와 일치합니다. 다음은 HTTP 요청의 예입니다.

PUT /view/31011898 HTTP/1.1 
Host: api.podio.com 
Authorization: OAuth2 your_oauth2_token_here 
Content-Type: application/json 
Cache-Control: no-cache 

{ 
    "layout": "table", 
    "name": "SPAM", 
    "rights": [ 
     "delete", 
     "view", 
     "update" 
    ], 
    "fields": {}, 
    "sort_desc": false, 
    "created_by": { 
     "user_id": <creator user id>, 
     "space_id": null, 
     "image": { 
     "hosted_by": "podio", 
     "hosted_by_humanized_name": "Podio", 
     "thumbnail_link": "https://d2cmuesa4snpwn.cloudfront.net/public/", 
     "link": "https://d2cmuesa4snpwn.cloudfront.net/public/", 
     "file_id": <some file id>, 
     "external_file_id": null, 
     "link_target": "_blank" 
     }, 
     "profile_id": <profile id>, 
     "org_id": null, 
     "link": "https://podio.com/users/<user id>", 
     "avatar": <avatar id>, 
     "type": "user", 
     "last_seen_on": "2016-10-27 19:58:22", 
     "name": "Podio TESTER" 
    }, 
    "sort_by": "created_on", 
    "items": 0, 
    "created_on": "2016-10-27 19:58:26", 
    "private": true, 
    "filters": [], 
    "filter_id": 31011898, 
    "groupings": {}, 
    "type": "private", 
    "view_id": 31011898, 
    "grouping": {} 
} 
+0

여기에서 모든 필드가보기 (예 : created_on)를 업데이트하는 데 필요하지는 않습니다. 이것은 단순히 볼 샘플로서 의도 된 것입니다. –