I'm working with laravel and I have done login with Google in laravel using socialite. Now I'm trying to get google contacts and I'm using Artdarek\OAuth for this. But I'm getting an error
TokenResponseException in StreamClient.php line 68: Failed to request resource. HTTP Code: HTTP/1.1 400 Bad Request
here is error screen shot
I also tried many links, but I don’t know what’s problem with my code.
Related
I'm making a custom connector with an Elasticserach API and when testing the connector, the following error appearsenter image description here. The URL show me the following message enter image description here
You have posted your token in the body. Your token should be submitted via the header.
I am using this Laravel google translate package to translate the website based on the user's locale. I configured everything well and the translation seems to work quite well on the localhost. However, when I upload the website to the server, google translate throws error 429 too many requests:
[2020-09-17 08:04:03] production.ERROR: Client error: `GET https://translate.google.com/translate_a/single?client=webapp&hl=en&dt=t&dt=bd&dt=at&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&sl=auto&tl=en&q=Canl%C4%B1+Bahisler&ie=UTF-8&oe=UTF-8&multires=1&otf=0&pc=1&trs=1&ssel=0&tsel=0&kc=1&tk=40965.430971` resulted in a `429 Too Many Requests` response:
I have tried searching for the cause of the error and found this post in google groups talking about exceeded quota but I don't think that applies to my case since I am only translating a few texts that can't get to that limit. Does someone have an idea on how to solve this?
I'm trying to get the list of albums as it is written here: https://developers.google.com/picasa-web/docs/1.0/developers_guide_protocol#ListPhotos
GET https://picasaweb.google.com/data/feed/api/user/default
Authorization: Bearer MY_ACCESS_TOKEN_HERE
So, the problem is that I get "404 Unknown user" responce. Strange thing but when I make the same request with the same access token from another PC, I get the correct responce (200 OK and list of albums).
I didn't google anything useful except the similar issue which was on API for Python (like here: AuthSub: (404, 'Not Found', 'Unknown user.')). Did anyone face the same issue?
So, the problem was that Google Photos server handles the requests incorrectly, if these requests contain some wrong Cookie headers.
I say "incorrectly" because other Google APIs (like Drive, Contacts, etc.) didn't have this issue.
So, all that I had to do is to add flag INTERNET_FLAG_NO_COOKIES in InternetOpenUrl function:
InternetOpenUrl(NetHandle, PChar(Url), PChar(Header), Length(Header), INTERNET_FLAG_RELOAD or INTERNET_FLAG_NO_COOKIES, 0);
After that sending HTTP requests using InternetOpenUrl with the flag won't return this error anymore.
At the moment I am attempting to share a link on Facebook without the use of JavaScript or a Facebook app id.
Previously I could have a hyperlink to: https://www.facebook.com/sharer/sharer.php?u=urlhere and Facebook would scrape for og:tags and allow me to share a site.
At the moment I'm encountering a 500 error when I attempt to submit a link that has not previously been crawled by Facebook.
How to reproduce the bug
Find a new link that you're certain hasn't been crawled by FB. Good examples of this are tweets.
Attempt to visit https://www.facebook.com/sharer/sharer.php and paste in your link
Submit the form and see the post preview
Attempt to submit the post
If you've used a fresh URL there is a good chance you'll get a 500 error similar to: POST https://www.facebook.com/ajax/sharer/submit_page/ 500 (Internal Server Error)
If you refresh the page and attempt to submit the same URL again, it will post successfully.
Once the link has been crawled by Facebook, it works without problems
Anyone having similar problems with this method of sharing?
This is a valid Facebook bug, see https://developers.facebook.com/bugs/795945327148024/.
When I try to fetch contacts from gmail, I received this error message:
The page you have requested cannot be displayed. Another site was requesting access to your Google Account, but sent a malformed request. Please contact the site that you were trying to use when you received this message to inform them of the error. A detailed error message follows:
The site "http://url.com" has not been registered.
May I know how to rectify it? Thanks!
Have you tried registering the domain with Google's API?
docs:
https://developers.google.com/accounts/docs/RegistrationForWebAppsAuto#new
resgister url:
https://accounts.google.com/ManageDomains
Also if you are making calls from http and not https you may be seeing problems there too.