I've been working with the Mirror API, specifically the php quick start project. I'm receiving an error after attempting to subscribe to timeline updates:
An error occurred: Error calling POST https://www.googleapis.com/mirror/v1/subscriptions: (400) callbackUrl must be a valid HTTPS URL
I do have SSL enabled and working on my test server.
In the subscribe_to_notifications function on mirror-client.php (line 111) I see a reference to the callbackUrl: $subscription->setCallbackUrl($callback_url);
However, I am not able to find where to change this. Should it be set to notify.php? Can someone get me pointed in the right direction?
Found out the issue, in config.php my $base_url needed to be set to the secure version.
Related
We have three environments, Dev, QA and Prod.
We have a stable PHP running that connects with evernote , get token and fetch content.
we updated our QA environment to PHP 7.0 and now when via evernote when we try to fetch Token it returns
Invalid auth\/bad request (got a 411, expected HTTP\/1.1 20X or a redirect)
Here is the code
$oauth = new \OAuth($this->consumerKey, $this->consumerSecret);
return $oauth->getRequestToken($this->getEndpoint('oauth'), $callbackUrl);
I have checked that consumerKey etc and everything is correct.
I am not sure what error could be here since 411 is normally when you need to send content length, but in Evernote API they dont mention anything like this
Is this due to PHP 7.0 ?
Any help will be appreciated
Thanks
Yes, you probably need to send the content length.
Does Evernote change the API validation for the Content-Length?
I see there is another workaround proposed on Github.
My live, staging and localhost had a page where it had a map and store finder.
6 months down the line this now does not work and havent touched the code. I have renewed my API key and still no luck. Now i know the API V2 is now not in use and im wondering if i am using the wrong code (confused myself). In my store finder i have this url:
$url = "http://maps.google.co.uk/maps/geo?q=".urlencode($this->input->post('postcode'))."&output=json&key=MYKEY";
Now reading this page ( https://developers.google.com/maps/documentation/geocoding/#JSON ) this has changed but i just cant seem to get a valid url working!
The error i get is: Message: file_get_contents(http://maps.google.co.uk/maps/geo?q=sr3+4as&output=json&key=MYKEY): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden
And when i type the url string into google i get this message:
We're sorry...
... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now.
If someone can guide me to if my url string is wrong above OR if this is another issue i would appreciate it.
Thanks!
According to the upgrade guide this endpoint URL:
http://maps.google.co.uk/maps/geo
Is using the v2 geocoding API.
Developers switching from v2 may be using a legacy hostname — either maps.google.com, or maps-api-ssl.google.com if
using SSL. You should migrate to the new hostname: maps.googleapis.com.
This URL based on the information in the update guide works for me:
http://maps.googleapis.com/maps/api/geocode/json?address=nebraska&sensor=false
I am working on creating a shopify and have run into some problems. When trying to authenticate the users, I get this error message:
{
"error": "invalid_request",
"error_description": "The redirect_uri and application url must have matching hosts"
}
The redirect_uri and Application URL are both set to 'http://serv.dudeami.com/shopify/public/'. I am not sure if its the subdomain throwing it off, but no matter what I changed the redirect_uri to it would not work. I am url encoding the redirect_uri.
I decided to do some test, and I can only get it to work with setting the client_id and scope. Without setting the scope or having an empty scope, I get an 'invalid_scope' error (even though the API docs say https://SHOP_NAME.myshopify.com/admin/oauth/authorize?client_id=API_KEY is accepted for basic permissions).
This isn't a huge issue, as I can just detect if there was a 'code' param sent and handle the installation that way, but I'd much rather have it sent to a page specifically setup for handling the install process (Verification, Token Exchange, etc).
Seems I made a silly mistake and the redirect_uri got urlencoded twice.
I have the TwitterOAuth class and demonstration running on a local development server and I cannot get it to authorize. I have entered the new CONSUMER_KEY and CONSUMER_SECRET in the config.php. I have also synced the server time to NTP. I get the error message: 'Could not connect to Twitter. Refresh the page or try again later.'
var_dump($connection->http_code);
results:
int 0
ANY help or advise would be appreciated.
I am running PHP 5.3
When I try to ping the api server I can't.
C:\Users\Owner>ping api.twitter.com
Ping request could not find host api.twitter.com. Please check the name and try
again.
could this be the problem ?
I had some issues with this process as well. I don't exactly recall what resolved this error, but I followed This Tutorial (albeit a bit out of date) and made sure I explicitly set the callback URL in the twitter panel for my app. Also, and I believe this one also caused the int 0 return for me, make sure that if you are going with a hosting provider they allow CURL requests.
step 1: https://apps.twitter.com/app or go to your app setting
step 2: Unchecked the (Enable Callback Locking (It is recommended to enable callback locking to ensure apps cannot overwrite the callback url)) This box..
save and exit and check..
ThankYou..!
I am having an issue when upgrading from Facebook's PHP SDK version 2.1.2 to 3.1.1 in anticipation for the Oct 1, 2011 cutoff. The url appears to have changed:
FROM
https://www.facebook.com/login.php?api_key=MY_KEY
TO
https://www.facebook.com/dialog/oauth?client_id=MY_KEY
Everytime I generate the new URL I keep receiving "An error occurred with Website. Please try again later."
I have searched the wiki/faq on Github page for sdk, but haven't found anything.
Anyone else having this issue?
I had this exact same problem while converting a Connect application. I figured it out! Connect used the application KEY (which is alphanumeric). The new API / oAuth requires the application ID (which is shorter and numeric). An invalid application ID consistently returns this generic error. Hope this helps.
Just in case someone else has this same issue you can also try disabling sandbox mode on your app's config settings on facebook. My scenario was that I could login using facebook but no one else could.