FoxPro Programming
API calls in Foxpro
Gravatar is a globally recognized avatar based on your email address. API calls in Foxpro
  akiva hochberg
  All
  Oct 10, 2019 @ 05:56am

Hi,

I have been hired by a company part time as a FP programmer. They have a program written in FP which you may have heard of called AccountMate. They've asked me to integrate Accountmate with a Taxrate product by Avalara.

The task is - When an invoice is generated an API call is made to Avalara with the customer’s address, tax status and the items being purchased, and Avalara returns the tax, if any, for each line item.

The company Avalara has code for the following languages C#,Java/Scala/JRE,JavaScript,Python,PHP,Ruby

Can someone please advise me on where to look to be able to do this in Foxpro? Are any of the utilities on the West Wind site good for this?

Thanks, Akiva

Gravatar is a globally recognized avatar based on your email address. re: API calls in Foxpro
  Rick Strahl
  akiva hochberg
  Oct 10, 2019 @ 12:00pm

You can make API calls with FoxPro using HTTP. All it is is HTTP calls made to a server in a certain format.

We provide tools in West Wind Client Tools which provide easy access to HTTP functionality as well as common serialization tools for JSON and XML. There are also helper classes that make it fairly easy to call API services and automatically handle serialization/deserialization of data, but that depends on what data is returned from the server.

Here are a few links you can look at:

Access HTTP content over the Web

Using wwJsonClient for Service API Calls

Hope this helps,

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: API calls in Foxpro
  akiva hochberg
  Rick Strahl
  Oct 10, 2019 @ 07:29pm

I appreciate it, Thanks Rick!

Gravatar is a globally recognized avatar based on your email address. re: API calls in Foxpro
  Alejandro A Sosa
  Rick Strahl
  Oct 20, 2019 @ 11:36am

Hi Rick,

Along a similar line, a few years ago at SW Fox you showed a way to send a message between two VFP processes that are running in the same LAN without using a SignaR server.

Can you remind me how that was done, please.

Thanks in advance,

Alex

Gravatar is a globally recognized avatar based on your email address. re: API calls in Foxpro
  Rick Strahl
  Alejandro A Sosa
  Oct 20, 2019 @ 02:57pm

Yes using Named Pipes. I think that was using wwDotnetBridge though not API calls although that is possible too with a lot more effort.

It's in this SWFox Session White Paper:

10 Cool uses for wwDotnetBridge

Note this was for local intra-process communication. But Named pipes also support cross server messaging by providing a server name to the message writing interfaces.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: API calls in Foxpro
  Alejandro A Sosa
  Rick Strahl
  Oct 20, 2019 @ 03:02pm

Thank you very much Rick.

Alex

Gravatar is a globally recognized avatar based on your email address. re: API calls in Foxpro
  akiva hochberg
  Rick Strahl
  Oct 25, 2019 @ 09:08am

I downloaded the shareware version. I don't see wconnect.app amongst the files which according to the help file is required.

Please advise

Gravatar is a globally recognized avatar based on your email address. re: API calls in Foxpro
  Rick Strahl
  akiva hochberg
  Oct 27, 2019 @ 06:04pm

What are you trying to do exactly?

wconnect.app only downloads with West Wind Web Connection shareware version...

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: API calls in Foxpro
  akiva hochberg
  Rick Strahl
  Oct 28, 2019 @ 08:03am

I want to do what I wrote above at the top of the thread. So I want to test the HTTP functionality in your tools and confirm they will work for me.

Gravatar is a globally recognized avatar based on your email address. re: API calls in Foxpro
  Rick Strahl
  akiva hochberg
  Oct 29, 2019 @ 12:21am

It'll work for you... It's all just HTTP so that's what these tools are designed for.

I can't say anything more since you've been vague of what it is that needs to 'work for you', but if it's HTTP requests you need to make then these tools will do the job.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: API calls in Foxpro
  Paul J
  akiva hochberg
  Feb 5, 2020 @ 08:56am

I have a similar task.... connecting to Avalara from a VFP app. What solution did you finally use? Any details/examples would be appreciated.

Thanks, Paul

Gravatar is a globally recognized avatar based on your email address. re: API calls in Foxpro
  Paul J
  Paul J
  Mar 10, 2020 @ 07:30am

Just have say that wwDotNetBridge worked great on this integration of Avalara C# SDK with VFP.

Thank you for this excellent piece of software.

© 1996-2024