Symfony 3 consume api data without using ajax or Angular - php

I'm working on a rest API to sell as SaaS. I already have most of the functions that interest me (integration with Mercadolibre a Spanish web site, market payments, google maps, social networks and also the accounting management part).
But now I want to add the possibility for the client to have a FrontStore where they can offer services with a few default templates that feed on API resources.
The issue is that I do not know how I can keep it isolated from the API code without using Angular, as Angular for websites affects a lot to the SEO. (the control panel and the mobile app did not have problems because I asked for everything by Ajax but those two things are not customizable)
So I do not know what to do.
Summarizing the question is: Since they could give access to templates or themes but not to the backend, it will be on another server.
I had planned to make 1 instance of the program for each client, but I do not want to do that since I did multi-company and I want to take advantage of it.
But I want to offer my 10 basic templates, the service to make a premium and also the possibility of the client to upload their own page. I hope I was clear.
I work with Synfony 3.0.0 and Angular 1.6 on a LAMP platform.
I need some idea to make possible get data from another server that have the rest API and use it just for a website like showing products or that kind of things. But without using Ajax or Angular templating.
I leave you a image to clarify. The left side is the private part, this is not customizable for the client, the right side is the web site and I want make it customizable by templates consuming the data from the API.

i don't understand all but if you need to consume API without ajax or angular, you can use guzzle http to create a client class that contains all your webservices (like showing products or that kind of things). This a tutorial how can use it. Hope help !

Related

How to build a basic web app on WordPress site using AWS API Gateway

I want to build a simple Software-as-a-service web application that performs web scraping - the result per execution will be a table of results with several rows and columns. For the front-end, I wanted to build the website using WordPress since I am familiar with making basic websites there and like the plugins available. For the backend I plan on using AWS Lambda to perform the task serverless-ly. The user will log in to the site, then when they want to use the service will enter some keywords via a form, and that will send HTTP request to AWS API Gateway, which is connected to my Lambda function. Currently, the AWS Lambda function writes results into AWS DynamoDB as it goes - perhaps I need to write a second HTTP request method to query the results, or return the results in the same method that scrapes them instead.
Even after hours of googling, there are several areas in which I am unsure how to proceed, or if I have chosen the right path (I have no prior experience in this area.) Two of the biggest puzzles I have currently though are:
How can I use WordPress to send data to AWS API Gateway? Do I need to write some PHP code and if so what does it look like and where should I put it?
How can I present the results on WordPress site for the user? Should I keep the results saved on DynamoDB and query them when I want to present them, or should I store the results on the WordPress database? Ideally they would see a big table and have options to export to CSV, for example.
Thanks for your help and patience.
Cheers,
jack
There are a couple of possible ways this can be accomplished. One way is to just use webhooks. Most form plugins come with the option to use webhooks and doing it this way is pretty straightforward. Here is an article from WPForms on how to configure it WPForms and Webhooks. Below is an example of how I have used it. The example shows a form that sends data to AWS API Gateway which triggers AWS StepFunctions and also puts the customer information in DynamoDB
WPForms Webhook to AWS API Gateway

Zingaya possible call from web page Likewise By using Nexmo/Twilio (possible/not possible) to call click that button from web page?

Anybody help me for answer the following Questions.
Zingaya enables voice calls through any computer, right from a webpage. No download or phone is required. Zingaya offers this seamless voice calling capability to website operators – whether it’s a huge e-commerce enterprise or your personal blog. Simply embed a “Call” button into your website. Visitors can click that button and the call is immediately forwarded to your landline, mobile phone, Skype account, or other computer. All you need is a website; all your visitors need is a browser and microphone. It’s that easy.
https://zingaya.com/
https://api.zingaya.com/ZingayaAPI2/Reference.pdf
Likewise, By Using Nexmo/Twilio make a call from web page to particular mobile number is possible or not.
It is possible to do this with Nexmo. We wrote a blog post about this back in 2018. It still provides a good example of the code you would need to implement to make this possible.
However things have changed a little since then and it is now possible to build a click to call button using the Nexmo JavaScript Client SDK.
All the code and all the steps to go through to build it are in the Client SDK Documentation
Absolutely possible with Twilio using a few different approaches.
Call across the public telephone network (PSTN) - connecting both via their regular phone.
Connecting the two parties and calls using VoIP (using WebRTC)
A combination of both approaches for each call leg
You can also layer on a lot of additional call routing logic and/or mix channels based on your requirements (voice and SMS for example).
Build Click-to-Call into your Web Application
Twilio Client Javascript Quickstart

Output JIRA filter to website via REST query?

I'm creating a kind of portal for my team as part of our company's annual Hackathon and wanted to include results for a specific JIRA filter on the front page of said portal. Idea is so that when you log in, you bring up the portal and it'll show you a list of the latest issues say or upcoming changes or RFCs for your attention.
Could I do this via REST where a script automatically grabs the content and then updates a HTML or PHP file with it?
Yes, depends on your JQL I believe you can do it via REST API. Atlassian documentation contains couple of good examples of the REST API and JQL. You can take a look at it here.

Magento realtime data integration

this could possibly be answered somewhere allready, but unfortunately I could not find the answer that would suit me.
The question is, can Magento be used only as a front end E-Commerce platform? That is read product nad customer data from external API, and also submit that data to external API. The trick is that it has to be done in real time, not via sheduled tasks.
If there are any Magento plugins that would allow for this, could someone mention any specific names?
Also, how complicated is adding custom functionality to Magento, without "hacking" the system (Things, like multiple shop branches, product sets, that can be enabled per branch, limiting orders to cetain amount of slots per hour etc.)
The entire Magento code base uses the Magento database tables for generating the frontend display, so there isn't really any way around it unless you plan on doing a rewrite on every core model to perform the necessary logic (i.e. fetch from/update external source). Existing solutions to this problem generally use the SOAP API and cron jobs to mirror the data (mapping as necessary to get it between the different structures) on both Magento and whatever external system you're using. You can achieve real-time results using the Magento observer system to send updates to your external system by listening to various model save events, and similarly create a SOAP API call when data is updated on your external system (specific implementation details depend on the system) to keep them in sync in real-time.

Is it Possible to get itunes like xml/json data from android market for each App

Itunes provide URL or all apps in App-store like to get details in JSON/XML Format
http://itunes.apple.com/lookup?id=[appid]
There is no any API for android market i have got online. i tried to get details from these html pages using java script by fetching android market query
https://market.android.com/details?id=com.[companyname].[app name]
but it is not getting fetch all the relevant data as iTunes. Is there any way i can fetch all data from android market app page html code or any API available for this?
May be it's help to you http://code.google.com/p/android-market-api/
By the way, last rumors, Google has renamed Android Market to Google Play.
To expand on devzorg's answer, - yes http://code.google.com/p/android-market-api/ will give you the application data you seek. And no - the format isn't (quite) valid JSON, although it is close afaik. The example snippet below (from an AppsResponse using the Android Market Library) won't pass JSON validation on jsonlint.com until you add quotes to all the variables and a set of external parens.
app {
id: "v2:com.geodesic.munduTV:1:30818"
title: "Mundu TV- Mobile TV, Live TV"
appType: APPLICATION
creator: "Geodesic"
version: "3.4.4"
rating: "3.6129606"
ratingsCount: 2253
..
}
Unfortunately Google Play (previously known as Android Market) does not expose an API like the Apple App Store, officially named iTunes Search API.
To get the data you need, you could develop your own HTML crawler, parse the page and extract the app meta-data you need. This topic has been covered in other questions, for instance here.
If you don't want to implement all that by yourself, you could use a third-party service to access Android apps meta-data through a JSON-based API.
For instance, 42matters.com (the company I work for) offers an API for both Android and iOS, here more details:
https://42matters.com/app-market-data
The endpoints range from "lookup" (to get one app's meta-data, probably what you need) to "search", but we also expose "rank history" and other stats from the leading app stores. We have extensive documentation for all supported features, you find them in the left panel: https://42matters.com/docs/overview
I hope this helps, otherwise feel free to get in touch with me. I know this industry quite well and can point you in the right direction.
Regards,
Andrea

Categories