Chatfuel Show "Buy" button (via Stripe) using the JSON API block - FB Messenger - json

I'm trying to build a Facebook Messenger bot using the Chatfuel platform but I came to a halt. I can't find anything about displaying the "Buy" button via the JSON API block. I'm trying to use the Stripe version, not the native FB Messenger purchase feature as the users will be outside of US. Now the button works fine when adding it using the Chatfuel's UI but I can't figure out how to show the Buy button via JSON API.
How should the JSON template look like? What tags do I need? I've been trying to use the examples from the official FB Messenger docs but nothing works, I end up getting the An error in JSON plugin has occurred / Unable to parse JSON message.
Can anyone please guide me in the right direction on how the JSON template should look like in order to display a buy button?
Many thanks!

Apparently there is no way to achieve this at the moment. I've got this answer in the Chatfuel FB support group:
"Unfortunately not possible. You'll have to use a Chatfuel redirect to a buy block or use a webview or create a normal buy button with a link to your checkout process behind it."

Related

Is there a way to access the HTML of an In App Browser (Themeable Browser)

I am using the ionic framework and would like to be able to read from the HTML from the current webpage and then send the selection back to my application.
I have the Theme-able Browser Plugin setup and can use it like any other web browser.
I have tried looking at ways to include my own script with the .executeScript() function but no luck.
I have also tried to read data from custom buttons that I have inserted into the tool/nav bar but that gives me the HTML of my application.
TL;DR: (Basically want access to the DOM of the current webpage and have the user use native selection to read the document.getSelection() and send that text back to my application.)
Any help would be highly appreciated.
After browsing the forums on Ionic I found the solution:
browser.executeScript({code:'window.getSelection().toString();'}).then((selection)=>{
packet.text = selection[0];});
This allows me to get the selection.

Using Instagram API for simple web page

So I am working on a fairly simple project, basically a web page that should list the captions from a certain instagram account. It's all designed, it just needs to be lit up with the content. Have a look at http://evanshellborn.com/speechofthebeets/.
I found that you can see a json file containing all the necessary data at instagram.com/{username}/media. So in my case, https://www.instagram.com/beets_are_life/media/. So before I put that page actually online, I was on my local machine, and I did a JSON call to that page and it worked perfectly. So I built it all out and my web page loaded the captions just like I wanted it to.
Then I went to put it online, (http://evanshellborn.com/speechofthebeets), but it doesn't work. Have a look at the script at the bottom of it, on my localhost that code works and the captions get loaded. But on the live page, I get an access not allowed error in the console. So I think Instagram doesn't allow this sort of direct access anymore, you have to go through their API.
Now I've tried looking at the API but it seems rather confusing. Basically what I'm asking for is a different JSON url that would give me the same result as https://www.instagram.com/beets_are_life/media/, but that would work from the live page.
I think https://api.instagram.com/v1/users/{user-id}/?access_token=ACCESS-TOKEN would work, just replacing {user-id} with the appropraite user_id. But where do I get an access token?
From reading https://www.instagram.com/developer/authentication/, it looks like you get one when a user puts in their user credentials. But I don't want to have anyone log in, I just want a simple web page.
Hopefully that made sense. How can I do what I want?
Looks like the API url https://www.instagram.com/beets_are_life/media/ does not support jsonp (no callback support), so u cannot use javascript (client side) for making API request, it will fail because of Access-Control-Allow-Origin error on browser side, you have make this API call on server side as proxy.
I guess https://www.instagram.com/<USER_NAME>/media/ is not a publicly documented API, thats the reason it is not supporting jsonp, Instagram uses it for their website and since it is same-origin it will work for them on client-side
This link will help you embeding the instagram on a simple html webpage.
There is a button on the bottom of the post on instagram.when you click on the link a menu pops up. then click on embed
now a box pops up
just copy paste the html and you are done.
it will fetch the post for you

Facebook AS3 api - mobile login window missing cancel button

I am using this, somewhat outdated, library.
When i log in a webview loads the following url
https://graph.facebook.com/oauth/authorize?client_id=123456789&display=touch&redirect_uri=https://www.facebook.com/connect/login_success.html&type=user_agent&scope=publish_actions,user_friends
I get a working login page, but there is no cancel button. Am I using the wrong address, or is this something the library would be responsible for adding?
Regards,
Jacob
Do not use this library. It is not maintained any more, and wasn't updated since oct. 2011 ... It is broken.
I use the Facebook API in AIR using HTMLLoaders and URLLoaders. All the flow is documented on the facebook developper's pages. But it's not that easy.

Loading JSON Feeds in Jquery Mobile and Phonegap app

I am new to jquery mobile and dont know much about working with its events and functions.
I am currently developing a phonegap app using jquery mobile.I went through many online tutorials to get started.In my jquery mobile app I have a RSS feed reader that loads my blog posts into the div showing a preloader first.
Now, I somewhere found a tutorial of loading JSON feeds instead of RSS.
But the problem with it is that it loads the posts without showing a mobile loader.I mean if i compile that app for android the user has to wait for a long without knowing whats going on.
I tried the Jquery mobile preloader like in my RSS app.But it still first calls the JSON script and then shows the preloader.
I want to make the JSON one work like the RSS reader which shows a script loader till the posts load.But when i try to do so the JSON feeds do not load. :(
Here is the demo of both the apps.
RSS:
http://silverjewelbox.in/rss
JSON:
http://silverjewelbox.in/mobile
If any one knows actually how to figure that out.I can also provide the code for the needed modifications.
Thank you,
You don't want to use Google for a JSONP server because Google caches the searches. Create your own JSONP RSS Feeds Server. See this article on CodeProject with full source code for creating RSS JSONP Feeds for PhoneGap Cordova Mobile Apps: http://www.codeproject.com/Articles/788762/PhoneGap-Cordova-JSONP-RSS-Feeds

Documentation for getting Facebook feed stream on website?

Trying to integrate a Facebook page stream into an element for a website?
The Facebook Like Box has a "show stream" option that displays this data.
Be aware, it is against Facebook's policy to exactly copy any of it's features and use on your own site (as if emulating Facebook).
With that said, you need to grab this information manually using either the Graph API or FQL. There is no social plugin that can do this automatically.
You can check out the Graph API documentation here: https://developers.facebook.com/docs/reference/api/
You can test out some Graph API calls here:
https://developers.facebook.com/tools/explorer/
You can learn more about FQL here:
https://developers.facebook.com/docs/reference/fql/