Instagram realtime api https - api

I'm coding an app in PHP and I've had issues starting a tag subscription when I don't use HTTPS, I've tested both ways and would prefer to use HTTP if possible.
Has anyone else run into this and know of a solution?
Their documentation doesn't show the need for https. When I use HTTP I get the error
Unable to reach callback URL "http://...

My issue wasn't https vs http. It was my function that curls the post data. I rebuilt it and it works now.
A note for future people trying to use the Realtime API it returns zero data about the Instagram post which I find odd, why note include a post id at the very least. All it currently does is ping your server with data about your subscription effected. Its also worth noting to see that data you have to use this command in PHP
$igdata = file_get_contents("php://input");

Related

How to receive XMLHTTPRequests on Server side?

it's probably I pretty dumb question but I just can't find any information online on how to do this. Probably I'm googling the wrong stuff.
I have to do 2 things. Send xml files via XMLHTTPRequests to a given Server. That's not a problem and easily done. But the company I'm working with also wants me to provide a Server that can receive XMLHTTPRequests and saves them into a file which I can then work with.
How do I handle this? Does I have to setup e.g. NGINX to do this or is this just a specific website I have to host? When I google for XMLHTTPRequests I only find how to send or get data but not how to setup the Server Side. I really have no clue.
Hope you can send me the right way so I can finally continue to work on this.
ty :)
You need a web server server side to receive requests from XMLHTTPRequest calls. You could set up NGINX to do this, or use any web server that you want.
This isn't usually covered in the documentation because you need to serve the page that contains the JavaScript with the XMLHTTPRequest from some server. To get to the point where you are making a XMLHTTPRequest, you already need some HTTP server set up and working. You would usually configure the page to be served from some a main URL like https://example.com/ and have the XMLHTTPRequest call to another URL like https://example.com/log-data would have you logic for storing to a file like your requirement.

Google oauth is responding with redirect_uri_mismatch error

My site is already live, example - https://www.example.io (with https)
I always get back this error
For some reason it is using HTTP although in the credentials i use https.
Btw this google API is already in production.
I'm not sure how to debug this. i tried http://localhost:3000 and it works perfectly for local development.
I'm using https://github.com/jaredhanson/passport-google-oauth with node.js
It works after i added a slash at the end
https://example.com/auth/google/callback
to
https://example.com/auth/google/callback/
I'm not sure though, but hope that this will help other people

Requests to an API endpoint denied due to Testcafe prepending request URLs - solutions?

When Testcafe runs against our local site, every request it makes during the test steps are prepended with something like http://192.168.1.182:59304/http://localhost:3000 (port number varies per run).
For the most part this works, but our web application makes calls to certain APIs during a user journey, and within TestCafe they might look like: http://192.168.1.182:59304/http://www.example.com/api/v2/customers/1 which come back with a 401 and response body of 'unauthorized'. Some API calls are fine, however.
I guess my question is:
Are there any way to get around this from my side, such as rewrite certain requests, or do I need to contact the API provider - and if so, what would they be potentially looking to do to allow these requests to go ahead?
You have faced this issue: https://github.com/DevExpress/testcafe-hammerhead/issues/2344. It was fixed. Try to run your tests with the latest TestCafe version (1.8.8-alpha.3).

Url scheme in Facebook feed dialog

So I finally got a link in my facebook post using the properties parameters. I thought I could put my url scheme in there. But unfortunately it says it isn't a valid url, which makes sense. So I searched again for another solution. But everyone seems to be talking about fb:// and not their own app url scheme.
So I created this thread, hope somebody can help me.
Try using bit.ly (or some other URL shortener).
The last time I tried, bit.ly accepted any URI schema and just did a redirect. I've successfully used this in the past to work around inputs that expected either an HTTP or HTTPS schema.
Additionally, similar logic could be done on your own server if you prefer. Simply share a link to your own server on Facebook, and have your server side script do a 301 to whatever App specific URI you have.

google weather api links need human authentication

I developed a weather app using google weather API
but from today it stopped working.
When I tried to access the weather API using location through browser it asks for human authentication.
How can my app work when it is like this? Is there a way to bypass the authentication process?
It's very odd behavior...I wonder if it has something to do with headers that are passed along as when I try loading the API url in Chrome, Unsupported API...or if I do same URL in Firefox, works just fine.
It's also worth noting that I tried setting up an Apache Proxy to Google's weather service by placing the following two lines in a separate Web Server's apache config and referenced the API via www.domain.com/weather/api?weather=Chicago and it still works...so that's my workaround for now:
ProxyPassReverse /weather/ http://www.google.com/ig/
ProxyPass /weather/ http://www.google.com/ig/
Try to change domain, ex: http://www.google.ca/ig/api?weather=Sondrio . It works (for now :D).
Looks like it is out of use from now on
Even using .CA it returns Unsupported API randomly.
Pity
Yeah, interesting, Google seems to send back random "Unsupported API" responses if the request is missing the cookies that the browsers (tested with Chrome and Firefox) are including with requests to the inofficial weather URL.
I've fixed my application by copying the entire "Cookie:" header I found when I ran the request in Firefox with Firebug's "Net" tab enabled.
Not sure where on .google.com the browser got the cookies from yet, I presume from using a personalized service like gmail.
if you are looking for a weather API that works right now, I have a suggestion…
Try Metwit Weather API, it's new but sounds very cool…
This api is really simple to use because it use standards that are available nowadays, like JSON and REST.
you can use this new api this has the same xml structure of google weather api
http://en.previmeteo.com/professionals/google-weather-api.php