New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to upload image after authentication #28
Comments
photo:@"Test" here you can fill you blog name |
But if i dont know the blog name then how can i directly post to tumblr so that i can see it under post section on my home page ? |
Even i created a blog at tumblr and passed the same in photo:@"My Test Blog" , i am getting "Error posting to Tumblr". |
I am guessing that you are not passing the blog name correctly. "My Test Blog" is not a valid blog name, as blog names cannot have spaces in them. This is an example of how to post a photo. As far as I can tell you are doing everything right except passing a blog name. You can get the user's list of blogs by making a |
yes i was not passing a valid blog name. My requirement is to post directly on user dashboard from the app. To achieve this i must pass a valid blog name as per api method. But suppose i want to post a photo on dashboard then but i need to do. Is there any method to create a blog so that after blog is created i can post the photo or any method to directly post image on user dashboard ? Hope you are getting my requirement !!! |
Mine still doesnt post [[TMAPIClient sharedInstance] photo:@"sankaet" filePathArray:@[post[@"gif"]] contentTypeArray:@[@"image/gif"] parameters:@{@"caption" : [NSString stringWithFormat:@"test post by %@",post[@"user_fullname"]]} callback:^(id response, NSError *error) { The error is Error Domain=Request failed Code=400 "The operation couldn’t be completed. (Request failed error 400.)" response { I guess the problem might be error uploading a photo that isn't on the device itself. does it have to be? |
Sorry, I am not getting your requirement. The dashboard is not something that can be posted to. Blogs have posts and if you follow a blog, its posts show up on your dashboard. You always need to be posting to a blog name that the currently authenticated user owns.
Yes. The |
would a Cached NSData work? |
No, sorry. Only paths to files on disk for now. |
I am trying to save the data on disk before I upload even that doesnt seem to work
Am I doing something wrong? |
There could be any number of things going wrong. Use an HTTP proxy to ensure you're actually sending image data across the wire. It could be that the GIF you're trying to post is too big (a common problem), feel free to use the image from this fully functioning photo posting example to rule out a problem with your particular GIF. |
I tried
even then it gives me an error Error posting to Tumblr Error Domain=Request failed Code=400 "The operation couldn’t be completed. (Request failed error 400.)" and response { and when I use my GIFs it gives me the following error JXHTTPMultipartBody.m (78) ERROR: The operation couldn’t be completed. (Cocoa error 260.) |
Did you read my last comment? Did you verify that you're actually sending multipart data up to the server using an HTTP proxy? Did you try using the image in the fully working example I linked to? Seriously look at the raw HTTP requests made by the sample program and yours, using the same image file, and see what the difference is. This isn't an SDK issue at this point, you're running into some problem with the API. I'm guessing it's because your file either A) doesn't exist or B) is too large, as I previously stated. I don't know what else to tell you. |
Hi irace, suppose i am a new user on Tumblr and not following any blog. So how i can post a image using Tumblr API for iOS ? |
This is a general Tumblr question, and not really related to the Tumblr SDK. How many blogs a user is following has nothing do with posting. You post to your blog, not someone else's. Every user has at least one blog; their primary blog's name is the same as their username. I'd suggest reading through our help documents to get a better understanding of how Tumblr works: http://www.tumblr.com/help |
"Did you verify that you're actually sending multipart data up to the server using an HTTP proxy?" I am not sure how to do that. I did try to run the PhotoPostExample, that works just fine. Then I used the same code and the same image in my app and its still giving me the same error. I am not sure why |
also, the text posts work just fine, but still it doesn't show which app the post was made by (as it usually shows in the right hand corner), am I missing something? |
No, only a few select applications are currently whitelisted for attribution. |
Is the multipart method of posting photo still supported by the API. I could not get it to work. Finally, got it working by going down to the lower level method
|
It's still there, can I see a code sample that wasn't working? |
The following did not work for me. I double checked that the image does exist in the bundle and that I can post text postings with the same credentials.
|
I too am having difficulty posting a photo using the Photo example project. The error message is not helpful at all. Given that it's an example project the onboarding should be cleaner than this. |
Same issue here. I copied the blue.png into my project, successfully completed authentication, checked my blog name with userInfo, but still cannot get the picture posted. Error Domain=Request failed Code=400 "The operation couldn’t be completed. (Request failed error 400.) |
[TMAPIClient sharedInstance].OAuthConsumerKey = k_TUMBLR_CONSM_KEY;
[TMAPIClient sharedInstance].OAuthConsumerSecret = k_TUMBLR_SECRET_KEY;
[[TMAPIClient sharedInstance] authenticate:@"myapp://tumblr-authorize" callback:^(NSError *error) {
}];
I am trying to post image after authentication, i am able to authenticate using above code but not able to post image after success full authentication. I am getting @"Error posting to Tumblr". I did some debugging and getting request callback JSON below:
(NSDictionary *) $1 = 0x0715df70 {
meta = {
msg = "Not Authorized";
status = 401;
};
response = (
);
}
Please guide me what i am missing ?
The text was updated successfully, but these errors were encountered: