Getting PhotoSets for Authenticated User

Hi,

I am trying to get a list of photo sets for an authenticated user. I have tried using LoadPublicProfile, but the list of photo sets under RecentPhotoSets all have null Titles. If I try using LoadPrivateProfile, RecentPhotoSets has no photo sets and is null. Is there an issue with these methods? Or should I be using a different method?

John

Comments

  • John WuJohn Wu Member Posts: 4
    edited August 2014
    Here is the request I used for

    POST /api/1.8/zfapi.asmx HTTP/1.1 Host: api.zenfolio.com Content-Type: application/json Content-Length: length X-Zenfolio-Token: [token for authenticated user sparkbooth] { "method": "LoadPublicProfile", "params": ["sparkbooth"], "id": id }

    In the response, note nulls in titles for RecentPhotoSets
    { "result":{ "$type":"User", "LoginName":"sparkbooth", "DisplayName":"Sparkbooth", ..... "RecentPhotoSets":[ { "$type":"PhotoSet", "Caption":null, "CreatedOn":{ "$type":"DateTime", "Value":"0001-01-01 00:00:00" }, "ModifiedOn":{ "$type":"DateTime", "Value":"0001-01-01 00:00:00" }, "PhotoCount":0, "ImageCount":0, "VideoCount":0, "FileCount":0, "PhotoBytes":0, "FileBytes":0, "Views":0, "Type":"Gallery", "FeaturedIndex":0, "TitlePhoto":null, "IsRandomTitlePhoto":false, "ParentGroups":null, "Photos":null, "Keywords":null, "Categories":null, "UploadUrl":"http://up.zenfolio.com/sparkbooth/p372815516/upload2.ushx", "VideoUploadUrl":"http://up.zenfolio.com/sparkbooth/p372815516/video.ushx", "RawUploadUrl":"http://up.zenfolio.com/sparkbooth/p372815516/raw.ushx", "PageUrl":"http://sparkbooth.zenfolio.com/p372815516", "MailboxId":"36RUB55C4JENW", "TextCn":0, "PhotoListCn":0, "Id":4084214148806260380, "GroupIndex":0, "Title":null, <----- *** Title is null even though has been set via Organizer site *** "AccessDescriptor":null, "Owner":"sparkbooth", "HideBranding":false }, { "$type":"PhotoSet", "Caption":null, "CreatedOn":{ "$type":"DateTime", "Value":"0001-01-01 00:00:00" }, "ModifiedOn":{ "$type":"DateTime", "Value":"0001-01-01 00:00:00" }, "PhotoCount":0, "ImageCount":0, "VideoCount":0, "FileCount":0, "PhotoBytes":0, "FileBytes":0, "Views":0, "Type":"Gallery", "FeaturedIndex":0, "TitlePhoto":null, "IsRandomTitlePhoto":false, "ParentGroups":null, "Photos":null, "Keywords":null, "Categories":null, "UploadUrl":"http://up.zenfolio.com/sparkbooth/p366417729/upload2.ushx", "VideoUploadUrl":"http://up.zenfolio.com/sparkbooth/p366417729/video.ushx", "RawUploadUrl":"http://up.zenfolio.com/sparkbooth/p366417729/raw.ushx", "PageUrl":"http://sparkbooth.zenfolio.com/p366417729", "MailboxId":"36RUB55BXF6U2", "TextCn":0, "PhotoListCn":0, "Id":4084214148799862593, "GroupIndex":0, "Title":null, <----- *** Title is null even though has been set via Organizer site *** "AccessDescriptor":null, "Owner":"sparkbooth", "HideBranding":false } ], "FeaturedPhotoSets":[ ], ..... }, "error":null, "id":2 }

    Using the LoadPrivateProfile API
    POST /api/1.8/zfapi.asmx HTTP/1.1 Host: api.zenfolio.com Content-Type: application/json Content-Length: length X-Zenfolio-Token: [token for authenticated user sparkbooth] { "method": "LoadPrivateProfile", "params": [], "id": id }

    In the response, note both RecentPhotoSets and FeaturedPhotoSets are null
    { "result":{ "$type":"User", "LoginName":"sparkbooth", "DisplayName":"Sparkbooth", ..... "RecentPhotoSets": null, <----- *** Should be 2 photo sets instead of null *** "FeaturedPhotoSets":null, ..... }, "error":null, "id":2 }
    Post edited by John Wu on
  • alexfalexf Administrator Posts: 1,174
    I'd suggest using LoadGroupHierarchy if you need to get all of the photosets.

    RecentPhotoSets only returns the ids of a few recently added photosets.
    -- AF [Zenfolio]
  • John WuJohn Wu Member Posts: 4
    Thanks! LoadGroupHierarchy worked. The only thing is I have a private Gallery that is not being returned in Elements with that call even though I am passing the X-Zenfolio-Token for the account that created the Gallery - I only see the public PhotoSets.
  • John WuJohn Wu Member Posts: 4
    Oops, nevermind. My token was old. It does display my private PhotoSets. Thanks!
Sign In or Register to comment.
Help test new Zenfolio features by applying to become a Beta Tester. More info here.
Join our live streaming Zenfolio Customer Support Q & A session on You Tube!

Thursday's at 2pm EST 11am PST

NOTE: You can sign in using your Zenfolio account! To link both accounts, make sure both email addresses match before signing in.
If you have a new feature idea that you think would be a great addition to the Zenfolio service please submit it to our feature voting system.