I am integrating twitter api in my application.
When I am trying to tweet I am getting an error:
Request A2C3E4D7-D3E8-47AD-A47C-3AC0DF2975A7 failed with error: Error Domain=HTTP Code=401 The operation couldn’t be completed. (HTTP error 401.)
I saw there is function defined with sendUpdate name. It is looking for parameter updateID and it is having zero (0) value all time. I am supposing this is occurring due to zero value in updateID.
Please help me. How to update in twitter from iPhone application. My consumerkey and consumersecretkey is right.
Thanks
Related
In my messenger platform app, when I make this request:
GET https://graph.facebook.com/v2.8/${psid}?access_token=PAGE_ACCESS_TOKEN
(to get users public info based on their PSID), sometimes Facebook returns this error:
'There is an error when trying to get the user\'s info from Messenger:\nError: failed [400] {"error":{"message":"(#100) Invalid parameter","type":"OAuthException","code":100,"fbtrace_id":"FpUUkuX0egc"}}'
I have no idea why this happens, because when I saw the error then I manually made the same request (by using POSTMAN), I got the correct result (user public profile) with no error.
Maybe you can check if POSTMAN is sending something in the headers in a different way that you are doing. It happened to me something similar and it was that POSTMAN was "correcting" something.
Compare the request from POSTMAN and the one you are doing with your app side by side.
If that doesn't work, let me know and I'll look into another option. :)
I am looking for some samples which I can use to post/retrieve feeds to/from groups in sales force chatter. While googling I have come across Chatter REST API in conjunction with RestKit. I was unable to run this sample which i have downloaded from github
https://github.com/cseymourSF/Chatter-API-iOS-Sample
After running the code i am able to login to sales force via application. But for the below
Request :
Sending asynchronous GET request to URL ///services/data/v23.0/chatter/users/userId.
(ex:///services/data/v23.0/chatter/users/me)
Error:
User fetch failed with error: Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo=0xa58ffa0 {NSErrorFailingURLStringKey=///services/data/v23.0/chatter/users/userId, NSErrorFailingURLKey=///services/data/v23.0/chatter/users/userId, NSLocalizedDescription=unsupported URL, NSUnderlyingError=0xa5906d0 "unsupported URL"}
and the current url i am suing is below:
https://na15.salesforce.com/services/data/v23.0/chatter/users/me
any help could be appreciated.
It seems like REST API wrong method invocation
Iam developing Iphone applications. i have integrated twitter in to my app, it is good up to login into twitter (authentication), but when we call method [engine sendUpdate] (for sending tweet), it says the follwing error has occurred.
Request CFE50DC4-02A0-46C1-BFF9-3F1F2E325C29 failed with error: Error Domain=HTTP Code=404 "The operation couldn’t be completed. (HTTP error 404.)"
Please tell me the solution.
Thanks
You'll need to upgrade your application to use the correct URLs.
In the case of API resource URLs, you want URLs that look like https://api.twitter.com/1/users/lookup.json
In the case of OAuth negotiation URLs, you want URLs that look like
https://api.twitter.com/oauth/request_token
Source: https://dev.twitter.com/discussions/2359
(I did not check it personally, Posting so that it may help others)
...i checked, (worked for me)
Replace: #define TWITTER_DOMAIN #"twitter.com"
With: #define TWITTER_DOMAIN #"api.twitter.com/1"
in MGTwitterEngine.m
Similar Post: Error 403 while getFollowers : Twitter Iphone MGTwitterEngine
HTTP 404 is a Not Found error, so it's likely that the URL you're using to send a tweet is incorrect.
Check what you have in your code with the twitter documentation at http://dev.twitter.com
Version 1 of the API is now deprecated. This document may describe an outdated version of the API. Please move to Version 1.1 of the API as soon as possible.
Go through this document.
https://dev.twitter.com/docs/api/1.1/post/direct_messages/new
Point to be noted
Api format should me json
Api version v1.1
sender and receiver should follow each other.
Example Request
POST : https://api.twitter.com/1.1/direct_messages/new.json
POST Data : text=hello&screen_name=rajneesh071
In my iphone app i am using Twitter-OAuth-iPhone to post and retrieve data from Twitter. The problem is that when someone wants to post a tweet twice(maybe by mistake) i need to tell him that the tweet was already posted.
when i do this i receive a 403 error from Twitter:
request failed with error Error
Domain=HTTP Code=403 "The operation
couldn’t be completed. (HTTP error
403.)"
the message doesn't tell me that i tried to post a duplicate Tweet. The 403 code, as specified here, is used when requests are being denied due to update limits.
A solution that i thought of is to keep in my app a list of tweets that where posted (an archive) that will be checked every time a new tweet is sent. The problem with this solution is that if someone is updating his twitter status from the web or other app it will fail because the archive from my app will not be updated.
I found a comment that says that the 403 code is just for duplicate tweets, but the documentation says otherwise.
EDIT:
on https://github.com/mattgemmell/MGTwitterEngine it says that:
In these cases you'll receive a call
to requestFailed:withError: which will
include an NSError object detailing
the error. Twitter usually returns
meaningful HTTP error codes (like 404
for 'user not found', etc), and in
that case the -domain of the NSError
will be "HTTP" and the -code will be
the relevant HTTP status code. The
userInfo of the NSError will contain a
key "body" that may contain the
response body and "response" which
will contain the NSHTTPURLResponse.
This makes it really, really easy to
know what's happening with your
connections.
but the userInfo attribute of the NSError that i receive in my app is null.
The problem is that Twitter-OAuth-iPhone for 4xx responses does not return the response body.
A solution could be to modify the MGTwitterEngine to provide the full error message. An example can be found here.
I use LinkedIn-iPhone API to update LinkedIn status, which worked for several times, but most times it does not work well, and it has never worked for the last 5 days. I don't know whether it is the problem of the LinkedIn web site or API connections.
The console log:
++ LinkedIn engine reports failure for connection
98A66D65-A8EB-4ADF-9B03-76EA54AE5DAE
The operation couldn’t be completed.
(HTTP error 400.), error: Error
Domain=HTTP Code=400 "The operation
couldn’t be completed. (HTTP error
400.)"
Is the error from the unstable LinkedIn API? or my code?
Silly me, I found the problem of HTTP error 400, which means: Duplicate updates. I changed the message for updating then it works fine.
Not sure whether moderator should delete this post or not? or how do I close it?