There is a company that uses salesforce software to keep track of all customers and the performance of the employees. I am building a points website, which is about the manager rewarding points to employees for a job well done. I want to integrate the info from salesforce software database about the employees and present it on my website so that the manager can see the number of deals closed by each employee and accordingly allocate points to that person. is there any kind of a plug-in or something like that? if not, how can i achieve this? My website is a cms, built on php.
Thanks.
The best way to handle this situation is to import the enterprise or partner WSDL into your PHP CMS. This will enable you to make webservice calls to Salesforce.com and access almost all of the data sitting on the Salesforce.com server.
It'll also enable you to write back to Salesforce.com servers. There is very good documentation and code samples out there try this link first:
http://wiki.developerforce.com/index.php/Web_Services_API#PHP
Hope this helps!
Check out the PHP Toolkit, which is a PHP wrapper around the salesforce API.
Be aware, there are some quirks and it's some bulky functionality. Salesforce limits the amount of hits you can have on the webservice, so you may need to do a cron-based "grab" of info and store to your site at various intervals. You'll get a rude awakening when you're testing and run out of connections for the day (not applicable to people who pay the premium level of Salesforce) It's also rather slow and has a propensity to timeout often....so be prepared to write code to handle the exceptions that will be caused.
Your server will need to have CURL installed and properly functioning.
Good luck!
Related
I have been looking for the answer for this question but it was a bit tough for me to come up with the query (question) itself. So if there is already good answer for the below question i would be very grateful for the link.
Let's assume I have an e-commerce web site and an API endpoint for future calls from mobile apps. My question is: should I duplicate logic for querying let's say product for product page on website or should I consider website as an API client and displaying product info by making CURL? request to API.
I suppose I should stick with last one. But I am concerned about making extra curl(TCP/IP) request within script. Will it be significantly slower for the overall response time? Are there any other "patterns" I am not aware of? Thank you.
Sites are on same server but API uses Phalcon PHP and website uses regular PHP
Duplication is definitely the wrong thing to do.
Technically, you have three options:
move the shared business logic to a separate repository and reuse it in both project as private composer package
use cURL/socket wrapper library to access the API (probably using Guzzle)
make public calls to the API using JS (preferably via fetch)
Each of these was drawbacks, so your choice would depend on which option hurts the less.
The shared library would have the best performance, but it would complicate the deployment process and there will be situations, when those applications (site and api) will have contradicting requirements. The problems are organizational.
Internally calling the API server over HTTP will make the site be a lot less responsive (since the TTFB will be a lot longer), but it would let you leave the API code completely unchanged.
Having it all in public comes with security and authorization problems. But, depending on how you expect the mobile API clients to be made, this could be seen as future-investment. But it will require substantial development time and someone who is skilled with javascript (maybe even with JS frameworks), since your website would have to be heavily altered. Most development-intensive option.
Using Laravel for PHP and DBMS. How do I make an app? (for social networking).
I have googled most of the things but I am really an Amateur and need help.
There are many kinds of apps, so before you start to work on your app, you need to carefully determine what exactly you need. You could write desktop apps for various operating systems, or native mobile apps, or hybrids, or a web application... You name it. Anyway, Laravel is the server-side and it should be as agnostic to the apps as possible. You need to create an API and handle the following things:
CRUD for the database
session (log in, log out, register, password change, user settings)
logical API functions
file transfer protocol usage
push notification (if needed)
As per your requirements, you will need to implement the server-side API in Laravel, which is a PHP-based framework and use an RDBMS, which could be MySQL, SQL Server, Oracle, or a NoSQL database, for instance MongoDB.
Before you implement any apps, you should have a proof-of-concept for the API. You should not invest too much time working out the details of the API, as when you are going to work on a real app, you will notice things to be changed anyway. The API should be accompanied by a playground for testing, maybe a very small app without design where you could send requests to the API. Or you can implement a WebSocket API to have a single, duplex connection. It is up to you.
As about how to write an API, there are many tutorials.
I need to build an iphone app that talks to a website. Logins, fetching data etc.
I have built few apps that does these using website's api but the website I'm working with now does not have one. I don't have enough knowledge of PHP or RoR so I'm not sure if I could build a back-end API from scratch and then start on the ios development.
I did some research and it looked like there are websites like parse.com or appactive where they help you with back-end api. Though, I looked around the website and read the about page but I'm still not sure how they work. Could those services help me if I already have a server/website running and I need an app that requires login and data exchanges?
Jus a note, in 2016 Parse has closed (it's now open source and you run it on Heroku or whatever). There are many other "baas" such as Firebase etc.
Since there seems to be some confusion,
(a) your current service has no API. it is, thus, unfortunately essentially useless so your most absolutely time saving step from here would be just scrap it and use parse (or another baas) as the backend. you can have parse up and running in minutes. what previously took server developers man-years is now just like "a consumer product", just make a few clicks to add column-names
(b) your current service has no API. assuming yo DO WANT TO continue to use it, you will have to somehow add an API, using php or whatever. there's no way to avoid this. IF you do that, then you could (if you wanted) make a "basic" API that parse can get the info from, and then use parse to actually connect to the ios/android builds (since that is so easy)
TBC, here's literally how you do that in Parse,
https://parse.com/docs/cloud_code_guide#networking
"Cloud Code allows sending HTTP requests to any HTTP Server" it's that simple.
As I mention above, it's far easier just to scratch your current backend and change to a bAAs (such as Parse). you have to "go with the times" you know?
Note that the development and testing of an API on a service is incedibly time consuming, it is a huge job for a team.
Here on this question you seem to be asking about bAAs and how they fit in the formula. the answers are:
(1) if you simply scrap your current service, do everything on a baas: it is trivial. what used to take literally man-years is now a few clicks
(2) in terms of "helping you ADD AN API to that service". bAAs cannot help you with that in any way and is irrelevant
(3) if you DO have a service with an API, yes it is relatively easy to have bAAs "link in" to that. (i include literally the doco from pare on doing that above)
Hope it helps!!!
We have built an electronic ticketing system using plain PHP and MySQL. After learning this system needs to be accessed on portable Android devices we hired an app developer to build us a simple app.
What is interesting is the app (from screenshots) functions almost identical to the web system we created. The app developer said after it's completed it will not rely on our system but communicate directly with the database. In the future if we update our PHP system he said we can update the app.
I'm just now learning how to develop Android apps. From what the app developer is saying it appears he's simply translating (compiling?) our code into an app. Is this possible? I'm aware there's a new method in building Android apps with PHP, but I seriously doubt he's doing that. Am I missing something, or did we just waste funds when we could have done something ourselves?
It isn't possible to run a PHP application on an Android device, no. However it could be running a lightweight browser inside an app, which accesses your website. Try making a small modification to your live site and then access the site again from your mobile device, to see if it changes.
The app developer said after it's completed it will not rely on our system but communicate directly with the database.
You don't want to communicate directly with the database - that sounds like it would require MySQL to be left open to the internet. That's not ideal from a security perspective (I don't know if Android has the drivers for it anyway). Instead, you should run an AJAX web front end and send commands (but not SQL commands) to the database that way, cleaning/untainting the input data thoroughly. Indeed, maybe that is what he is referring to?
or did we just waste funds when we could have done something ourselves?
It's difficult to answer that. If you discover something useful as a result of employing him, perhaps it was worthwhile? Of course, this illustrates that it is important to know the technical environment thoroughly when hiring someone, and perhaps when you hire someone in the future you'll discuss their technical solution prior to implementation. If you decide to pull out at that stage, pay them for the R&D and the technical spec, and do it yourself.
In any case, why wonder about it? As part of completing this item of work, ask for technical details of his implementation on both the mobile and server side. And of course don't forget to ask for the source code - hopefully it was written into the contract that you own this intellectual property.
A friend and I would like to create a website to manipulate Facebook data.
The structure is:
a PHP web role (contains the web page, user OAuth login, interacts with queues, and interacts with SQL Azure database)
an F# worker role (does statistics and quite heavy data extractions)
The process is (assuming a new user):
user arrives on the web page and logs onto Facebook via OAuth, the PHP web role then posts a message in a worktodo queue with the login info and token.
F# worker role reads the message off the worktodo queue and starts doing data crunching (using the Facebook API) and stats, then it writes the results to a SQL Azure database. Finally it posts a message to the workdone queue stating it has succeeded in doing the data processing for the user.
Finally the PHP web role reads the workdone queue and notices the work is done, and displays the algorithm results.
I have two questions:
Is there a big flaw in this design?
What is the best way to collaborate: one person will write the PHP and another the F#, is there a way to use development storage from two different machines?
Thanks a lot! (Apologies if some find this stuff too basic, I am very much a beginner in all these matters).
If you wanted to follow a bit more experimental path, you could also try looking at Phalanger. This is a project that compiles PHP code to .NET, so it may be possible to run it directly on Azure and nicely collaborate with F# (Phalanger has a few language extensions that allow you to call any .NET objects and some API for calling Phalanger objects from C#).
I was involved in the project some time ago, but it is now beign developed by other people (and as you can see from the check-ins, it is quite active again and they would surely be interested in collaborating to resolve possible Azure issues). If you were interested, let me know - I can give you some contacts, so that you can discuss the Phalanger status on Azure with them.
I don't see anything wrong with this plan.
I don't think there's a way to have two machines pointing at the same development storage, but you can just use cloud storage (even when running locally). I do that all of the time; you will pay for bandwidth and storage transactions, but for most apps in testing, this cost is trivial.