PhotoSmash Galleries
Any documentation for the mobile API? (2 posts)

  1. gggruse
    Posted 3 years ago #

    Does anyone know of any documentation for the mobile API to PhotoSmash? Any ideas where I could start to figure this out?


  2. gggruse
    Posted 3 years ago #

    Finally figured it out, here is the code to upload via iOS this is based on the ASIHTTPDataRequest framework....

    self.uploadRequest = [ASIFormDataRequest requestWithURL:myurl]; 
    NSString *POSTBoundary = [NSString stringWithString:@"0xKhTmLbOuNdArY"];
    [self.uploadRequest setPostValue:[NSString stringWithFormat:@"multipart/form-data; boundary=%@", POSTBoundary] forKey:@"Content-Type"];
    [self.uploadRequest setRequestMethod:@"POST"];
    [self.uploadRequest setPostValue:@"photosmash_api" forKey:@"action"];
    [self.uploadRequest addPostValue:@"upload" forKey:@"photosmash_action"];
    NSString *message = @"testMessage";
    [self.uploadRequest addPostValue:message forKey:@"bwbps_imgcaption"];
    NSData *imageData = UIImageJPEGRepresentation(self.currentImage, 1.0);
    [self.uploadRequest setData:imageData withFileName:@"photo.jpg" andContentType:@"image/jpeg" forKey:@"bwbps_uploadfile"];
    [self.uploadRequest setDelegate:self];
    [self.uploadRequest startAsynchronous];

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • PhotoSmash Galleries
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic