How does the Podio API endpoint update the view?

When I looked at the documentation for the View endpoint, there was very little information (see https://developers.podio.com/doc/views/update-view-20069949 ). Current documentation states that the endpoint accepts one parameter, view_id, but it seems that the consumer API will also want to provide additional information to change the definition of the view.

Is there any sample code to demonstrate how to use this endpoint?

+4
source share
1 answer

The Podio Ruby client provides code that uses this endpoint. If you look here , you can see that the endpoint expects the JSON body to be provided in the PUT, which defines the new view definition. In Ruby code, it is referred to as “attributes,” and this is consistent with the API documentation for other View operations. Here is an example HTTP request:

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": {}
}
+5
source

Source: https://habr.com/ru/post/1659110/


All Articles