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.
Related
I'm trying to send a TrustPilot invitation using the Create Invitations API but no matter what I try, I get a response code of 415 and with no data returned, so it's virtually impossible for me to debug.
The URL I'm using is correct: https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/email-invitations (where {businessUnitId} is my business ID)
I am sending a valid (and current) oAuth token in my header.
I am sending a POST request.
I have tested my details with other "Business user OAuth Token" APIs and everything works, so my details are definitely correct. It's just this create invitation API that's not working.
I've tried everything. I've submitted minimal details, a full request, somewhere in between, the example request in the API, and so on. Always a response code of 415.
I've set my "Invitation Settings" in the TrustPilot Business portal, and have even tried submitting those details with the request (ie. sender e-mail "noreply.invitations#trustpilotmail.com" and a valid reply-to e-mail that's been configured).
I've tried contacting the "Integration Engineers" at TrustPilot who after a few back and forth e-mails, also have no idea, which is VERY unsettling. So time for Stack Overflow.
I need to get this figured out, so any help would be great! Perhaps someone can provide a sample request that works in their application that I can try to duplicate in mine?
Http status code 415 (Unsupported Media Type) is returned when Content-Type: application/json is not passed. You need to make sure that this header is added and that the content you are passing in the post body is valid json.
If you are already doing this then I would need an example of a request you are sending to help you further.
This is the responce i am getting when trying to upload a file from my client(PHP),My server is on WebApi which is hosted in one server.In my webapi i have allowed all CORS related things still i am getting this error.
Have you checked this tutorial?
Maybe when you say
In my webapi i have allowed all CORS related things
you didn't do that correctly, or maybe you enabled too many options at the same time.
It's hard to give you more details without access to your actual configuration.
There are also many posts on the same subject here on SO, have you checked them?
I am newbie Parse and I have a problem. I want to use parse classes for dynamic content such as blog posts. Everyting works as expected there is no problem ; but when I try to fetch as google in Google Webmaster Tools it says AJAX blocked. So google will not index this content anyway.
when I follow the link I saw this below.
this is what I see when follow class link
So google crawler try to get ajax content but it comes to it with a ConnectionFailed aka 100 error. (I tested it to show in a label on page what returns in parse query error callback. So I see what renders google)
Am I doing something wrong is this an expected behaviour ?
Anyone knows how to solve this ?
Btw: I am hosting this website on heroku with custom domain over https (with cloudflare dns redirected and free ssl)
I also deployed to Parse Cloud Hosting unfortunately the result is same :(
This is the full result of the Fetch as Google :
full page result of fetch as google
The page at https://api.parse.com/1/classes/GameScore is asking for authentication, and it's throwing a 401 Unauthorized status code for unauthorised requests. That's already a problem.
Besides that, the page at https://api.parse.com/robots.txt is currently showing
User-Agent: *
Disallow: /
Googlebot can't access that page because it's disallowed for crawling in the first place, but even if it could access it, it would run into an authentication gate which it wouldn't be able to pass.
If the content from that URL (https://api.parse.com/1/classes/GameScore) is essential for the page where its referenced/used, you would have to work with Parse to allow crawlers access those URLs.
If it's not essential, then you can safely ignore that warning.
I try to use the yammer api. I did everything like specified in the docs (https://developer.yammer.com/v1.0/docs/js-sdk):
I created my own Yammer app, with my website (https) domain set in the Javascript Origins
I use the login button to receive my Auth token.
I set the token with yam.platform.setAuthToken
But any following request with yam.platform.request fails with "No 'Access-Control-Allow-Origin' header is present" although I can see in the network console that the correct token is sent through the Authorisation Bearer Header.
I found out that my code was working when accessing my home-network. For accessing any other network that i am a member of, the Yammer app should be globalized, see yammer client application external networks 401
I think you don't need to set yam.platform.setAuthToken yourself - that is taken care of by yam.platform.getLoginStatus.
You can receive the token from the response object provided to the callback function passed to getLoginStatus if you need to, but if your JS queries the API from the browser itself, there is no need for that.
I am using google place api for places sugestions.
https://maps.googleapis.com/maps/api/place/textsearch/json?query=ari&sensor=false&key=your_api_key
I have valid api key and this URL is working fine when I am executing it from the browser.
The api return "OK" as status and places suggestion but when I am executing the same URL by cUrl or file_get_contents It returns "REQUEST_DENIED" as status and hence no place suggestions.
why this is behaving like this.
Is there any setting which I am missing.
Any suggestion would be a great help.
Thanks
Did you ever get your answer to this? As far as I am aware this is die to "cross-site-scripting" security limits. You can't go from the Places API directly to Google even though you can in a browsers address bar. You have to make the call back to your sever and have the server send the call to Google - then return those results back to your page/ web site.