2

could anyone assist in authenticating to photobucket and uploading an image from and iPhone app? I am currently configured with many networks but I can't really find good documentation for the photobucket process. I guess the process is only authenticate and upload using customer key then username and password of the user?

Any help here would be amazing! Thanks in advance!

Jim

mejim707
  • 431
  • 3
  • 16

2 Answers2

4

Jim, the Photobucket (PB) process for authenticating is modified OAUTH. If you start looking at OAUTH examples you will find that you can authenticate on PB by simply converting a sample over to PB. e.g.: There's an OAuth starter kit set up for LinkedIN by Lee WHitney on Github courtesy of Kirsten Jones. Register an app with PB, get your keys and plug in the keys & correct PB URLs and you will be working. The URLS you need are:-

 requestTokenURLString = @"http://api.photobucket.com/login/request";
    accessTokenURLString = @"http://api.photobucket.com/login/access";
    userLoginURLString = @"http://photobucket.com/apilogin/login";   

This will get you logged in but there's a lot more to come. PB have a code page and there is an Objective-C library including a modified OAUTH but it's missing docs so you need to work it out by studying the code. Bitbucket Photobucket code for objective-c

The issue I have is to do with their usage of sub domains and trying to get OAUTH to work with that.

UPDATE: Solved: I have at last worked out how to get a part of the provided API working in my own Xcode project. Basically I added the special Oauth files which enable the requests to be set up correctly to get round the subdomain stuff. eg: OAuthASIHTTPRequest etc

I'm now getting full album info.

SundialSoft
  • 136
  • 8
  • Hi, thanks for the follow up on this. Do you by chance have a sample code you could provide on how to auth / access the account? – mejim707 May 18 '12 at 15:44
  • The best starting point is the Photobucket api for iOS. This includes everything required to get photo bucket working. It's not the easiest integration, probably 3 times harder than flickr which has a fully working interface in iOS. Either study that code & get it working as is or do what I did & lift the files into your own project. My code is a huge jumble especially as I had to hack the PB code to get it working with Tumblr & Smugmug so it would confuse rather than assist. – SundialSoft May 22 '12 at 13:14
1

Official documentation for Photobucket API is available at: http://pic.pbsrc.com/dev_help/WebHelpPublic/PhotobucketPublicHelp.htm . You can find examples for login and media uploading.

Client libraries for Photobucket API are at: https://bitbucket.org/photobucket/api/wiki/Client_Libraries . There is a Objective-C one, like SundialSoft mentioned in answer.

Hailei
  • 42,163
  • 6
  • 44
  • 69