How do I get a single piece of data from Quickbooks Online? - java

I've got a client who uses Quickbooks Online for accounts, and he wants to be able to read data from it programmatically. We're using Clojure, so any solution in Java will work, or http gets etc can be made directly if necessary.
They've got what appears to be a nice RESTFUL interface to their stuff, and a java library for accessing it, but I can't make head or tail of their documentation: https://developer.intuit.com/docs?redirectid=accounting, which all seems to be about webapps and OAuth and other stuff.
All I want to be able to do is get, say, a single customer record.
Can anyone point me to the simplest possible Hello World type program, in any language? (Preferably Java or something easy to read like python)
I'd imagine that what I'm looking for would look something like:
import quickbooksapi
username='fluffy'
password='doom'
cus=quickbooksapi.get_customer(username,password,id=4)
print(cus)
or something?
Or have I just got the wrong end of some gigantic stick here?

This looks the best available documentation:
https://developer.intuit.com/hub/blog/2016/04/25/quick-start-to-quickbooks-online-rest-api-with-oauth1-0
It's a recent blog post by a Quickbooks developer, showing how to get Oauth keys and then use curl to access the REST API.
It seems that you have to pretend to make a SaaS app in order to get one bit of gubbins and then there's another thing where you can get the rest of the gubbins.
After that you can use curl, putting all the gubbins in the headers. (The postman extension for chrome that he uses can generate curl commands and equivalents in many other languages)
It works exactly as advertised (6th August 2016).
That's enough. I can take it from there.

Related

How to Create Case in Microsoft Dynamics CRM 2016 (Version 8) using webservices or REST API in JAVA or C#?

I want to create a case in Microsoft Dynamics 2018(Ver.8) using either C# or java using web services.
After doing a vast googling I'm having hard luck with no or very few resources that are hardly useful. The Microsoft documentation is a complete dead end.
Following are my requirements:
Creating a CASE.
Updating CASE more likely closing of CASE.
Creating a CONTACT.
I need to perform these actions using Rest API or Webservice either in JAVA or C#.
Any help would be appreciated.
Assuming you are non on-prem, your data will reside in the Common Data Service (CDS).
So perhaps the reason why you can't find anything is because you are searching specifically for connecting to Dynamics.
There is full developer guide here:
https://learn.microsoft.com/en-us/powerapps/developer/common-data-service/work-with-data-cds
A sample POST request is below to create a entity - in this case ACCOUNT (be it a CASE or CONTACT you will need to ensure you have the right attributes corresponding to your entities).
https://learn.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/create-entity-web-api
For some code ready examples see below. I would suggest starting with a simple WebAPI connection, then using this as a base to contruct the operations you wish to complete.
https://github.com/microsoft/PowerApps-Samples/tree/master/cds/webapi/C%23/SimpleWebApi
Your best to stick to C# as there will be more examples around the web. But you can use any language you wish that has the abilty to create and post a request to the endpoint so JAVA can be used as well.

Does SonarQube have client libraries for web api with classes to store JSON?

First timer here and just starting with (the latest) SonarQube. Are there client libraries to download through the web-api already written and available? And is there a set of JAVA classes established that map to the structure of the JSON that will be returned that already exist? I was able to write my own test JAVA code to connect and to parse using the web api provided for one call I wanted, by building my own classes. But it seems like a lot of work to do this for all the data I hoped to pull and wondered if someone had done it already and/or Sonar provided it. And the web-api is a bit cryptic. Had to hover over values to figure out the exact call. I didn't see what I was looking for in the documentation or here. Or is there a better way to dump the data efficiently out of the GUI? Thank you!
Concerning, JAVA client library to request the SonarQube web services, we do not provide such library. There are lot of great tools to do a HTTP request and parse the JSON (see for instance OkHTTP and GSON).
Concerning "the web-api is a bit cryptic", I would be very interested to hear all your feedbacks about this, please share these feedbacks on the Google Group in order to discuss them and improve SonarQube web services.

How do I use java to fetch dynamic web content?

I've been programming in java for a little while and I've found no real way to even come close to this goal. My googling has been pretty fruitless as well.
I'm looking for a way to essentially download current weather (or other but weather is a good start I suppose) and save the current temp / humidity / dewpoint / next day forecast for those numbers into an array of strings
I have no idea where to start, but I figure that this will be a good place to start learning how to use java to fetch.
Thanks!
How would you approach this task in other language?
In the case of weather you would probably look for some API exposed by the site you're trying to get the weather from.
Here come some clues:
1. If you want to just issue an HTTP request, get a result (kind-of ajax style) and parse the web page you can use java.net package or if you want a (much more powerful) thirdparty lib, use Apache HTTP Client.
2. If you're looking for API exposed via WebServices (which I believe is a better approach here) then they're language agnostic, so you just turn to web services (SOAP/Rest) in Java just like in any other language.
I know, the answer is a little bit 'common', so please clarify 'how' are you planning to solve this issue (even in any other language)...
Hope, this helps
A good source for weather information is METAR. There is also a Java library jweather available which should encapsulate all network/protocol/api issues to a limited set of methods to retrieve the required weather information

How to extract data from Java web application?

I need to extract data from a Java web application. To be specific I am looking to extract real time stock data from yahoo market tracker. Can anyone please suggest any method?
I'm not sure you can extract the data from Yahoo Market Tracker. Even if you can, you might not be allowed to - I can't see any obvious terms & conditions/licensing. I think (although I could be wrong, anyone got better info?) that you'll need to pay to get access to an API providing near realtime market data.
There is a HTTP-based Yahoo Stock Quote API you could use to get prices, described here. Very simple, returns a comma-separated list of attributes for one or more stock symbols, for example:
http://finance.yahoo.com/d/quotes.csv?s=MSFT&f=snd1l1yr
It might not be realtime enough, but it might be the best you can do for free.
You can use glorious HTTP protocol to do that. Use any language you are comfortable with (Java, C#, VB.NET, python, ruby, php) and crawl the website you are trying to get information from.
I need to extract data from a Java web
application
From your standpoint, the fact that it is a Java Webapp or a PHP-one or static html pages doesn't change anything. It is not because Java is backing the webapp that suddenly you get a "Java-way" to extract the info.
Now in some cases there are APIs provided allowing you to interact with the data present on the website: but once again the fact that the Webapp is a Java one or not bears no importance.

Google Query from Java?

I'm writing a Java program, and I want a function that, given a string, returns the number of Google hits a search formed from that query returns. How can I do this? (Bonus points for the same answer but with Bing instead.)
For instance, googleHits("Has anyone really been far even as decided to use even go want to do look more like?") would return 131,000,000. (or however many there are.)
Related: How can I programmatically access the "did you mean" suggestion? (eg searching "teh circuz" returns "did you mean the circus?")
found it: http://code.google.com/apis/ajaxsearch/documentation/#fonje
The Google Terms of Service say this:
5.3 You agree not to access (or attempt to access) any of the Services
by any means other than through the
interface that is provided by Google,
unless you have been specifically
allowed to do so in a separate
agreement with Google. You
specifically agree not to access (or
attempt to access) any of the Services
through any automated means (including
use of scripts or web crawlers) and
shall ensure that you comply with the
instructions set out in any robots.txt
file present on the Services.
Google has ways of making life unpleasant for you / your company if you violate the Terms of Service ...
UPDATE: The second sentence is about the way that you use Google's services ... including their published APIs. It is not entirely clear from the wording what is allowed and what is forbidden; literally speaking "any automated means" is very broad. However a Java app that performed Google searches, screen-scraped the results and repackaged them to provide some value added service would (IMO) be a violation of the TOS. And using Google's published APIs to do the same thing would (IMO) also be a violation.
But that's my opinion, not Google's. And it is the Google opinion that matters. If anyone is thinking of doing something like this, they should contact Google and check that what they are proposing is OK.
The point is that Google is not going to assist people to subvert their search business model. Anyone who thinks they can get away with it based on some clever interpretation of the TOS is going to get burned.
for the first part of the answer, try read the t-o-s; for the "did you mean" part, see: http://norvig.com/spell-correct.html
You may be able to do it "legally" using the Google Java Client Library. I don't know for sure, but they may have some methods similar to what you're looking for, and you won't be violating their TOS.
Google Data APIs Library
You can legally access the Google AJAX Feed API through its RESTful interface:
http://code.google.com/apis/ajaxfeeds/documentation/#fonje
Bing still has a developer program where you can call against their API in a JSON/XML or SOAP matter:
http://www.bing.com/developers

Categories

Resources