Options

getAccessToken = "invalid/expired token"

ErgErg Registered Users Posts: 3 Beginner grinner
Hello, I applied for an API Key yesterday, and it shows up on my control panel page. However, when I try to use it (using c#+json api 1.3) getRequestToken returns without error, but getAccessToken always returns "invalid/expired token". Does it take a while for the API Key to become valid? If not, any ideas?

Thanks.

Comments

  • Options
    MSkaffariMSkaffari Registered Users Posts: 147 Major grins
    edited May 14, 2012
    Erg wrote: »
    Hello, I applied for an API Key yesterday, and it shows up on my control panel page. However, when I try to use it (using c#+json api 1.3) getRequestToken returns without error, but getAccessToken always returns "invalid/expired token". Does it take a while for the API Key to become valid? If not, any ideas?

    Thanks.

    Have you authorized the request token? Do you see the app in "authorized applications" section of your control panel?

    http://wiki.smugmug.net/display/API/OAuth
  • Options
    ErgErg Registered Users Posts: 3 Beginner grinner
    edited May 14, 2012
    MSkaffari wrote: »
    Have you authorized the request token? Do you see the app in "authorized applications" section of your control panel?

    http://wiki.smugmug.net/display/API/OAuth

    Thanks MSkaffari, no I do not. This is all I see. Do I need to "authorize" the app myself somehow?

    iv8kg5.png
  • Options
    MSkaffariMSkaffari Registered Users Posts: 147 Major grins
    edited May 14, 2012
    Erg wrote: »
    Thanks MSkaffari, no I do not. This is all I see. Do I need to "authorize" the app myself somehow?

    iv8kg5.png

    After getting the request token, you have to forward the user to ../authorize.mg with the request token. This step will let the user to Authorize the app to access their account. If you skip this step the system will see the token as invalid and won't let you proceed.
  • Options
    ErgErg Registered Users Posts: 3 Beginner grinner
    edited May 15, 2012
    MSkaffari wrote: »
    After getting the request token, you have to forward the user to ../authorize.mg with the request token. This step will let the user to Authorize the app to access their account. If you skip this step the system will see the token as invalid and won't let you proceed.

    Ah, I guess it would help if I understood oauth before I dug in :). Anyway, thanks for pointing me in the right direction. I got it working by simply pasting the request code into the authorize URL, then getting the access token and hard-coding it into my app. This is for my own small utility program, so that's all I needed.

    Thanks for your help!
Sign In or Register to comment.