Google Places API without HTTPS - php

I am having problems sending requests to the Google Places API because my machine is behind a proxy with authentification. I successfully worked around this in the past by using a context when sending http requests from PHP. I have trouble getting this to work with HTTPS from Google places and the easiest way would be to just use HTTP.
I cannot find the link for the HTTP API. The basic URL for requests is:
https://maps.googleapis.com/maps/api/place/search/output?parameters
(source: http://code.google.com/apis/maps/documentation/places/).
I am looking for a way to connect to this API without using https. Just using http://maps.googleapis.com/maps/api/place/search/output?parameters results in a 404.
Thanks,
David

You should write 'json' or 'xml' instead of 'output' in url.
like http://maps.googleapis.com/maps/api/place/search/json?..

Related

Requests from referer are blocked for accessing Google API

We used the third-party web app and tried to integrate this Google API for Translation.
Currently, it's working OK. We can call the API to do the translation.
However, when we started to restrict this by using the HTTP REFERRER. We keep getting: Requests from referer are blocked.
On the URL, we tried the combination below and no luck:
*.ourdomainname.com/*
ourdomainname.com/*
The developer helped us to identify this and come up with this error detail:
Requests from referer <empty> are blocked.
Any ideas? Currently, it's working OK if we are not putting any restrictions, which is not good :) We prefer to restrict this.
I'm appreciated your feedback.
Thanks

can I make an API request through google PHP API

I'm talking about this: http://code.google.com/p/google-api-php-client/
Is it possible to use a method in that API library to send Oauth GET/POST requests in general...
I've been scanning the source code, and I can't seem to find any such method...
What are you trying to connect with? Adsense/Analytics/Gmail or what? All that code does is get you an Oauth key, all GET/POST requests are separated by which google application your are trying to connect with. The documentation can be found here

Why do I receive different HTTP response codes when accessing Facebook XML feeds from different servers?

I'm using the Zend Framework, specifically the Zend_Feed class, to grab the Facebook XML feed at http://www.facebook.com/feeds/page.php?format=rss20&id=120635284755 and merge it with a similar Twitter feed for display on a website.
The problem is that while I can grab the feed absolutely fine from both my local and remote testing servers, when I launch the app live at [http://www.pycsam.com.au], it is receiving a 403 response code.
Until I work out what is going wrong, I am mirroring the Facebook feed through my testing server, which proves that it works just fine, but it's not a good long-term solution since it requires an extra request.
Is anybody able to tell me why I would be receiving a different response from the Facebook server when the request is coming from different servers?
Many thanks in advance!
403 means "Forbidden". This can have any number of reasons:
You need to authenticate at some point, and the authentication doesn't work
The IP you are making the request from is blocked by Facebook's servers for some reason
There is a proxy somewhere in between blocking access (rather unlikely I'd say)
you may be able to get more detailed info by checking what the request body has to say.

Client agnostic solutions for RESTful resource security/authentication etc.?

I'm about to replace my oldfashioned sessionbased server solutions with RESTful ones.
Where can I find information about design principles concerning security, authentication etc. when moving into this stateless domain?
I need to find solutions that work with different client platforms (Flex/Air, Browser, desktop and mobile apps etc.). Right now I work with php in the server end.
OAuth 2.0?
The easiest is basic http authentication; http://en.wikipedia.org/wiki/Basic_access_authentication
Learn from examples like Google accounts authorization, Yahoo REST APIs etc.
Some points to notice:
Cookies are usually used as
out-of-band authentication tokens.
Beware of AJAX calls failing
authentication - if they get a 302 redirect to a form, it will be followed automatically and you'll get a 200 response with the form body as a response

How is cURL related to web services?

well...just about all I needed to say...lookie here, I'm a total noob in web programming so go easy on me..and oh...if ever it is...could you point me to a simple example? i've worked wiht cURL on a payment API (Authorize.net) but I can't seem to get the picture of how it applies to web services
cURL is a library used to retrieve remote URLs.
There are plenty of other ways to do this in PHP, for instance using file_get_contents() but cURL offers much more flexibility.
It doesn't do anything special with web services - all it does is request URLs. Depending on the type of service you're using you might want to look at the PEAR SOAP module, PHP's SOAP classes or PHP's XML-RPC functions.
you can use curl to fetch a url (usually with a post request), and use the data that was fetched in you application.
curl operates as a client or useragent, in much the same way as requesting data from a website would be done from a web browser.
if you are doing strictly get requests there are other simpler was then curl, but curl gives a lot more flexibility, such as reading headers, raw data, etc

Categories