Getting Full HTML Source code in when using WP REST API - rest

Installed WP REST API v2Beta13 on Wordpress version 4.4.2 from here, and also gone through it's documentation.
When trying to use the api via POSTMAN and hitting URL:
http://www.example.com/blog/wp-json/wp/v2/posts as a GET request, whole HTML code of home-page (http://www.example.com/blog/) is returned as response.
In fact any URL is giving the html code of home page.
Expect output should be json formatted data as mentioned in it's documentation.
Permalinks setting in wordpress admin-panel is set to http://example.com/blog/sample-post/

Related

Accessing Smartsheet Oauth in html page

I have asked in my post earlier what url / redirect url I should use here:
how to request auth code from Smartsheet via Postman
An user suggested me to ngrok, it gave me a temporary website when I set the http to 80. However, I noticed the forwarding website given is different every time I type
./ngrok http 80
Here are my questions:
if the forwarding website is different , how am I able to get a 'allow access' page as I don't know what app url and redirect url I should put for my Smartsheet.
I tried to request the website by typing
./ngrok http80
It gave me a forwarding , so I type the website as my app url, and /callback as the redirect url, I still don't get the 'allow access' page
the Smartsheet documentation asks me to type in the following
https://app.smartsheet.com/b/authorize?response_type=code&client_id=dheu3dmkd32fhxme&scope=READ_SHEETS%20WRITE_SHEETS&state=MY_STATE
I tried to use postman for the command above, it does not show me any error nor showing the 'allow access' page.
I am trying to get the 'allow access' page to work in my html file, but I am not sure what code I should put.
I am novice to smarsheet API, any explanation in detail will be appreciated. thank you in advance.
Looking at the ngrok docs you can set a custom subdomain each time you launch ngrok. This way you can have the same URL for repeated use.
This way you could have a command to run ngrok look like this:
ngrok http -subdomain=testsmartsheetoauth 80
Your URL would look like this:
http://testsmartsheetoauth.ngrok.io
And your callback could be set to this:
http://testsmartsheetoauth.ngrok.io/callback
This should give you the persistent URLs you need that your app could use for the OAuth flow.

Debug Facebook Instant Articles in browser

according to this page (https://developers.facebook.com/docs/instant-articles/analytics) on the Facebook Instant Articles documentation is possible to debug them in a browser using the following url:
www.ia-tracker.fbsbx.com/instant_article_test?url=<share-url>
Now I keep getting the following error:
Notice The trackers are run in same environment as Instant Articles,
except that the base url is different. On Instant article, it's the
url, that the user shared.
I tried to use the canonical url, without http, with www but nothing worked.
Have someone been able to use this method successfully, and if yes what they mean by "share url"?
The debug page doesn't actually render your page in the browser, it running the tracking code it finds just like they would be run in the instant article renderer. If you open the source code of the page you will see that there is a tracker code loaded.
The purpose of that page is to test analytics code, not the FIA itself.
Basically you will have the error if you put wrong URL or if you put the URL to the article that doesn't have FIA implemented. That notice that you get is sign of successfully loaded analytics code from the FIA itself.

Given a facebook staging_resources image URI, how do I get out a usable URL?

I can successfully upload a png to FB's staging resources via the graph API: https://developers.facebook.com/docs/sharing/opengraph/object-api#objectapi-images-staging. This returns a URI of the form fbstaging://graph.facebook.com/staging_resources/XXX. The docs say:
Although this is a URI, it's for internal use only and is only a way to pass around an identifier. Referencing it as if it were an image will not return any useful data.
I'd like to use the staged image in a share dialog for the user, but for this I need a URL. When I pass the URI to ShareLink's image param (I'm using Unity's 7.2.2 FB plugin in Unity 5.2.4 but I think this is a generic issue?) I get an error because it expects image URLs to start with http:// or https://.
Is there a way to get the URL from this staging URI? The docs are unclear.
(You can phrase your answer in terms of the graph API explorer, I don't need a C# or Unity-specific answer)

dymaically changing the meta tag values!! works fine with debug tool but not working while posting with graph api explorer

I am posting an Open Graph "Level Up" action however while I am testing I am getting strange results. I have set the code to dynamically change the title so that it says Level "1", Level "2" etc.
url.php?level=6
. and this works perfectly on the debug tool, updating the title with whatever parameter value I pass in. The problem comes when I actually try to post using the Graph API Explorer tool. For some reason whatever parameter I pass, ie. =1, =2, it doesn't seem to take the parameter value. Has anybody encountered the same problem?
You can post request in Windows using Fiddler. Don't forget to set User-agent header (if you really check it).
I have the same issue. Checked my logs: FB does not even try to load my object by specified URL! After checking link in Debug Tool or making a request from Graph API Tool it will work.
There's already bug report on FB
Each URL needs to be accesible by Facebook's Debug Tool and needs to be be internally consistent without redirects or loops.
If on a page, you have an og:url tag, Facebook will load that URL instead, so if your URL includes parameters which control the output of the meta tags, the og:url tag needs to include the same parameters which loaded the page in the first place.
If you're not sure what the debug tool is seeing, and don't trust it for some reason, you can make a manual request using curl on the command line to see what Facebook is detecting:
url -A "facebookexternalhit/1.1" -i [URL GOES HERE]

security warning in IE9 "Show all content"

I'm implementing the facebook Comments plugin on my site. Users get the warning "Show all content" in IE9
This other publisher using the same plugin and it does not bring up the warning.
Can some please help me with this?
Asking users to turn of the mixed content warning in their IE9 is not an option.
We were just looking at this today and our workaround for now was to include the Facebook Library over https (even when the page itself is viewed over http). Although not ideal it gets rid of the mixed content warnings in IE9 until they have fixed their bug.
That seems to be how it was accomplished at www.vg.no linked in the original question, the library is linked via https.
From their code:
<script src="https://connect.facebook.net/nb_NO/all.js"></script>
I have the same problem:
I have a page that's 100% http. But, the facebook javascript (which I call over http), is returning assets (.js, images) over https, which is generating security warnings for IE(9) users.
I have figured out it's the comment widget from Facebook (
Here's an example of a live page on http: with the error:
http://app.gophoto.com/p?id=10173&rkey=CD01891B287792415384&s=1&a=6940
Here's one of the assets that Facebook returns over HTTPS
https://s-static.ak.facebook.com/rsrc.php/v1/y8/r/7Htnnss1mJY.js
(I'm unable to comment (for some reason?) on Joel's answer. But, his suggestion to fetch the initial all.js over https on http sites does not actually work. I've tried it, and it also inherently looks incorrect since even the initial js fetch violates the mixing up of http & https content.)