Skip to content

getUserProfilePhotos

Sahri Riza Umami edited this page Jun 25, 2018 · 4 revisions

Returns the profile photos of a user.
The result of this query may be outdated: some photos might have been deleted already.

getUserProfilePhotos(user_id, offset, limit, callback, data)
Field Type Description
user_id int32 User identifier.
offset int32 The number of photos to skip; must be non-negative.
limit int32 Maximum number of photos to be returned; up to 100.

Example

  • Get the profile photos of user 133780085.

    getUserProfilePhotos(133780085, 0, 100)

    Response:

    {
      ["@type"] = "userProfilePhotos",
      photos = {
        [0] = {
          ["@type"] = "photo",
          has_stickers = false,
          id = "1853347327200307113",
          sizes = {
            {
              ["@type"] = "photoSize",
              height = 320,
              photo = {
                ["@type"] = "file",
                expected_size = 15915,
                id = 4,
                ["local"] = {
                  ["@type"] = "localFile",
                  can_be_deleted = false,
                  can_be_downloaded = true,
                  downloaded_prefix_size = 0,
                  downloaded_size = 0,
                  is_downloading_active = false,
                  is_downloading_completed = false,
                  path = ""
                },
                remote = {
                  ["@type"] = "remoteFile",
                  id = "AgADBQADqacxG5NpuBnZ4mN0KL9zRX6W0DIABNMzDlGXPYbOdP0DAAEC",
                  is_uploading_active = false,
                  is_uploading_completed = true,
                  uploaded_size = 15915
                },
                size = 15915
              },
              type = "b",
              width = 320
            },
            {
              ["@type"] = "photoSize",
              height = 640,
              photo = {
                ["@type"] = "file",
                expected_size = 54676,
                id = 5,
                ["local"] = {
                  ["@type"] = "localFile",
                  can_be_deleted = false,
                  can_be_downloaded = true,
                  downloaded_prefix_size = 0,
                  downloaded_size = 0,
                  is_downloading_active = false,
                  is_downloading_completed = false,
                  path = ""
                },
                remote = {
                  ["@type"] = "remoteFile",
                  id = "AgADBQADqacxG5NpuBnZ4mN0KL9zRX6W0DIABDM2dhBCg4Lsdf0DAAEC",
                  is_uploading_active = false,
                  is_uploading_completed = true,
                  uploaded_size = 54676
                },
                size = 54676
              },
              type = "c",
              width = 640
            },
            [0] = {
              ["@type"] = "photoSize",
              height = 160,
              photo = {
                ["@type"] = "file",
                expected_size = 2611,
                id = 3,
                ["local"] = {
                  ["@type"] = "localFile",
                  can_be_deleted = false,
                  can_be_downloaded = true,
                  downloaded_prefix_size = 0,
                  downloaded_size = 0,
                  is_downloading_active = false,
                  is_downloading_completed = false,
                  path = ""
                },
                remote = {
                  ["@type"] = "remoteFile",
                  id = "AgADBQADqacxG5NpuBnZ4mN0KL9zRX6W0DIABA1gF44vf3m0c_0DAAEC",
                  is_uploading_active = false,
                  is_uploading_completed = true,
                  uploaded_size = 2611
                },
                size = 2611
              },
              type = "a",
              width = 160
            }
          }
        }
      },
      total_count = 1
    }

Frequently Asked Questions
The Functions

Clone this wiki locally