I want to test the Twitter api for an app in the future. I was trying to test it with Postman but I get this error all the time.
"code": 32,
"message": "Could not authenticate you."
I made an new app from my developers account and put all the generated tokens into postman like this:
My parameters are the same like this screenshot: (with the correct tokens)
Do I need to check something important?
I hope someone has already faced this problem or just can help me with this.
Under the "Authorization" tab in Postman, choose "Request Headers" from the "Add authorization data to:" drop down.
Useful reference:
https://developer.twitter.com/en/docs/basics/authentication/guides/authorizing-a-request.html
Error 32 "Could not authenticate you" can also happen when the content of the tweet triggers the Twitter censorship filter.
For anyone still having issues...
My problem was that the Content-Type: application/x-www-form-urlencoded header was not set for my POST request when testing with Postman. Once I added that, all was well.
Another thing to check is the ! character in the status that's being posted. Ensure it's encoded correctly.
See here for more details: https://groups.google.com/d/msg/google-appengine/6ILDt39anbs/gEwMVBNJLkYJ
Follow the picture and you will get the correct return.
Related
All the API's work in the browser but none of them is working in my android app and postman.
Status:
In postman and in my app, error code received is:
500 Internal Server Error
I think your problem is csrf-token you can disabled it in
App\Http\Middleware\VerifyCsrfToken
and add your routes name in this array
$except = [] array.
It could be that postman is missing some request headers, cookies or session data. You could look into using Postman Interceptor. It's a tool which records requests made from Google Chrome and clones them to your Postman history. From that history tab you can simply replay the request, which will be an exact clone. Maybe that'll resolve the 500 errors you're getting.
I want to identify how many topics a single device is subscribed to. Then I found and followed this post. I don't know if I follow it right because i receive this message
{"error":"MissingAuthorization"}"
Here are the steps:
Get token from the device
Generate a URL: https://iid.googleapis.com/iid/info/<paste token here>
Copy-paste the URL to the browser
Get the response.
I don't know if I'm doing something wrong. I hope someone can help me solve this problem.
It's saying that there is no authorization specified. Make sure you're including the Authorization:key=<Server API key here> in your request, where the Server Key is the one found in your Firebase Console, under Cloud Messaing tab.
Yeah this how you check Add the KEY=
U forgetting to put the Authorization starting with "KEY=BLALALALALA"
Authorization
I'm using gradle-play-publisher library to upload my app to Google Play, but I get error 401 Unauthorized when executing the publishing task.
My dev account at Google Play and service account at Dev Console are set up. Play API is enabled.
As I see from build logs, the first request sent is:
POST https://accounts.google.com/o/oauth2/token
I get 200 OK and the following json:
{
"access_token" : "< some value here>",
"token_type" : "Bearer",
"expires_in" : 3600
}
Then the next request is sent:
POST https://www.googleapis.com/androidpublisher/v2/applications/< my app's package name here>/edits
First of all, I noticed this header among others:
Authorization: <Not Logged>
And second, I get this error as a response
401 Unauthorized
WWW-Authenticate: Bearer realm="https://accounts.google.com/", error=invalid_token
Has anyone faced the same issue? Everything seems to be set up correctly, so I have no idea what went wrong. Thank you.
Your error means that
server responded with 401 (Unauthorized) status code but failed to provide a single auth challenge (WWW-Authenticate header) thus making it impossible for HttpClient to automatically recover from the authentication failure.
Check your HTTP POST request in you application which might expect
some short of credentials in the HTML form
I hope that you are already testing your rest API(url) by using POSTMAN google chrome extension.
Now,if your rest api works fine then consider about using that in your code, step by step try to figure out the following
server implementation is wrong or client side implementation wrong or url
parameters are wrong
check for <uses-permission android:name="android.permission.INTERNET" /> in your
AndroidManifest.xml
I'm using google place api to develop a mobile application.
The Http request I sent was:
https://maps.googleapis.com/maps/api/place/autocomplete/json?sensor=true&key=KEY&components=country:uk&input=hu
But when I sent HTTP request to the Google server, it replies OVER_QUERY_LIMIT:
{
"predictions" : [],
"status" : "OVER_QUERY_LIMIT"
}
I have checked the instruction provided by Google and Android document, and also I have checked the usage of the requests from reports in the Google Console. But I found the used request is only 3, and the request/sec is 0.0017.
Could anyone provide some help on it? Thanks very much!
Oh...I have fixed up my error.
The reason was that I was using a public-shared API_Key by mistake, so sometimes I could get the result, but sometimes couldn't.
Android I am using jTwitter
Twitter my_twiter = new Twitter("my_user_name","my_pass");
my_twiter.setStatus("hello world");
line 2 throws
winterwell.jtwitter.TwitterException$E403: Forbidden http://twitter.com/statuses/update.json (my_user_name)
what does that mean ??
One reason Twitter will return a 403 error is if you repeatedly post the same status message. That's probably what you've encountered here.
Try adding a random number to your test code, e.g.
my_twiter.setStatus("hello world "+new Random().nextInt(1000));
By the way, I see you're using the username/password login method. Twitter have announced they're switching that off - I think at the end of August. You may want to switch to OAuth. See the JTwitter homepage for details: http://www.winterwell.com/software/jtwitter.php
403 Forbidden: The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits.
Statuses over 140 characters will also cause a 403. But since you are just doing "hello world" that shouldn't be the case. The response body will contain a detailed error message.