How do I update my web app's database when a change is made on QuickBooks Online? - mysql

I have a web app with a MySQL database we maintain in the cloud that we are trying to integrate with our QuickBooks Online account. We want to sync data between or web app's database and QuickBooks online, such as customer names and addresses. If they update their address in or web app, it's easy to then update it in QuickBooks online using the QuickBooks Online API. However, if they tell us their new address over the phone and we change it directly in QuickBooks online, we have no idea how to have that trigger something so that it automatically updates our MySQL web app. How do we go about doing this or learning about this process?

Intuit/QuickBooks has an API that's specifically geared towards this use-case. From the docs:
The change data capture (CDC) operation returns a list of entities that have changed since a specified time. This operation is for an app that periodically polls Data Services and then refreshes its local copy of entity data.
Docs are here:
https://developer.intuit.com/docs/0100_accounting/0300_developer_guides/change_data_capture
Basically you make an OAuth signed HTTP GET request like this:
https://quickbooks.api.intuit.com/v3/company/1234/cdc?entities=Class,Item,Invoice&changedSince=2012-07-20T22:25:51-07:00
And you get back a list of objects that have changed since the given date/time.
Your application can remember the last time you called this, and periodically call this API to get things that have changed since the last time you called it.
You get back something like this:
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2013-04-03T10:36:19.393Z">
<CDCResponse>
<QueryResponse>
<Customer>...
</Customer>
<Customer>...
</Customer>
</QueryResponse>
<QueryResponse>
<Invoice>...
</Invoice>
<Invoice>...
</Invoice>
</QueryResponse>
</CDCResponse>
</IntuitResponse>

Related

Simple Esri/ArcGIS Online connection using a link or iframe

I was asked by a potential client if I can have my software interact with Esri/ArcGIS Online.
Use case: users is logged into SomeRandomSoftwareApp and is looking at a Widget, this Widget includes an Esri asset id, the user clicks a link that passes that ID to Esri/ArcGIS Online and behind the scenes the user is logged into Esri and they see the data associated with the Esri/ArcGIS Online.
Thanks, Keith
If I understand correctly, you have two options for this: API Keys or Application Credentials.
The first one, is a permanent token generated by the owner of the data that will allow the application easy access to it. This is still in beta, and it was not ready for use the last time I check some time ago.
The second one, the owner of the data will generate credentials for your application. With this credentials you will have to request a token each time you want to access the data, all this via OAuth 2.0.
Check the docs for more details ArcGIS Services - Security

How to store data temporarily while redirectring within 2 OAuth Steps

I've read a lot of questions and look after a lot of sources, but I could not get the idea. That's because there is lot redirects happening with my application, let's see a quick look over the steps.
Step1. Login with [MyApp1]
1.1 get tokens via POST method
Step2. [Save tokens temporarily] < Stuck here.
Step3. Login with [MyApp2]
3.1 get tokens via POST method
Step4. Encrypt all tokens
4.1 Save it to MySQL Database
I do not know what is best to save the data temporarily, I looked over sessions and Redis, I am working on Node.js Web Application, HTML with a Server and MySQL Database.
Perhaps store them in the query? OAuth2 provides a state query parameter that is applied on redirect so your application can pass some information to itself after redirecting.

How to send back data to a server in a PWA website

I've searched and I can only find tutorials to pull info from a server to update the latest info of my PWA app using JSON. But I can't find any way and any example to fetch data back to a server to mantain for instance a Database updated and display that to all users which may use that PWA.
For example, I have a PWA that let me login (client-server communication), then it displays a list of contacts that were stored in a Database. I can delete, modify or add new users to this list from my PWA app, and after doing that, they'll update on my server Database, so if my friend Paul, wants to check the updated list from his account, he'll see the new changes.
How Can I do that? Which language would I have to use, php and Javascript (Ajax)? Which is the most fluid and optimized way to do it according to a Progressive Web App.
I guess you are trying to store user changes back to the server(webservice and then to the data base).
You have to make an AJAX call to your web service and pass the required data needed to store in DB.
Here is an example.
https://www.w3schools.com/xml/xml_http.asp
Depending on the framework you are using, you might have more options to call a web service. Like here is an example for Angular -> https://www.w3schools.com/angular/angular_http.asp

Publish DB updates remotely to Meteor

Suppose I have a Mongo DB database in Meteor, let's say for books.
ISBN | Title | Year
Now updating this fields from Meteor is no big deal, but suppose I want another web application to publish new books that the has to go into the Mongo DB.
For example the publishing app can call a web address like this:
How can I handle this http request from Meteor please? Is there a library or known mechanism for this.
Thank you!
if you are going to talk to the MongoDB directly from your other app, then you don't need anything from Meteor: when the DB is updated, Meteor will see the changes.
If you mean 'how can I build a REST API through my Meteor App?'
then you could have a look at packages like simple:rest or restivus
https://atmospherejs.com/simple/rest
https://github.com/kahmali/meteor-restivus
This allows you to access your Publications or Methods through http calls like you would with a REST API.
collection books could be called with
http://myapp.com/publications/books
With Methods you can handle POST, UPDATE and DELETE verbs.

OAuth for Enterprise account

I'm creating a web app for my company that will keep a number of files in sync with the files on Box. This will be done by using a cron job running every hour.
I have the application working by setting the developer token in my account, this was done for testing whilst I was building the application.
Now this is working I want to get the authentication working so I can just leaving this running. So I'm trying to work out if there is a way I can have an API key for our enterprise account or if I will have to implement OAuth and connect one user to the application, which seems to be a bit overkill?
You should probably use one of the SDKs, which take care of refreshing the tokens for you.
Essentially what you'll need is a keystore to store the tokens. You could store the Refresh-token only. When your cron wakes up, use the refresh token to get a new access-token and refresh-token. Store the new refresh token in your keystore. Then make your API calls using the Access-token, and then go back to sleep.