Album API endpoint - retrieving Unlisted albums

robrobrobrob USARegistered Users Posts: 2 Beginner grinner
I'm calling "!albums", and I'm getting a result that has albums that are public. How can I also get Unlisted albums?


  • gibertigiberti SmugMug Engineering Director Registered Users Posts: 19 Big grins

    You'll have to make an authenticated call using OAuth. This means passing an appropriate Authorization header. There are a lot of guides that can walk you through this process and there are helper libraries available for pretty much every modern language and request library. Note that we use OAuth 1.0a, which is very different than OAuth 2.0, so make sure you are working with the correct version.

    APIv2 and OAuth are your friend! Having issues? Just ask, I can help!
  • robrobrobrob USARegistered Users Posts: 2 Beginner grinner
    edited August 5, 2018
    Here's what I'm doing in python 2.7 (key/secret/token set up previously):

    from rauth import OAuth1Service
    from rauth import OAuth1Session
    import json

    service = OAuth1Service(
    base_url='htt ps://')

    session = OAuth1Session(

    "htt ps://!albums",
    headers={'Accept': 'application/json'}).text).get('Response').get('Album')

    How can I tell if the call is authenticated? I went through the whole thing about getting the numeric code and entering it on the page in the browser to get the token.

    (Edit: url's above edited to allow forum to let me "post links")
  • mardymardy RussiaRegistered Users Posts: 10 Big grins
    Your code looks correct. To make sure that you are properly authenticated, try calling the!authuser endpoint instead.

    PhotoTeleport: open source, multi platform photo uploader.

Sign In or Register to comment.