Asana user photo API request misses photo field in json response

StackOverflow https://stackoverflow.com/questions/23452595

  •  15-07-2023
  •  | 
  •  

Вопрос

We make requests to the Asana API for user photo opt_field. We constructed the asana users query like this:

https://app.asana.com/api/1.0/users\?opt_fields\=name,email,photo,workspaces

The reponse returned is

    data =     (
            {
        email = "user2@gmail.com";
        id = xxooiio1664;
        name = "User 2";
        workspaces =             (
                            {
                id = 104764788xxxyyy;
            },
                            {
                id = 4983461zzzjjjj;
            }
        );
    },

But the photo field has been missing. Did we miss anything in the request?

Это было полезно?

Решение

When you use opt_fields, it only returns fields you explicitly request, and each of the images is considered its own field for this purpose. So you would need to specify e.g. opt_fields=photo.image_60x60.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top