Knowledgebase: Miscellaneous
Sage eBusiness Web Services API Notes v4.5
Posted by Joe Rebis on 14 November 2014 10:25 AM

This is a random collection of notes and information regarding the Sage eBusiness Web Service API v4.5 that are not immdiately obvious from the docs. I hope you find them useful and we welcome any API web development work. Please call the main number and press 1 for sales. Please do let us know if you find any issues or incorrect information with the document. 

 

Installation of the web service and it's configuration in IIS is important- be sure to read through Appendix B of the documents and follow all instructions closely.

There are permisisons for access to the web services that must be enabled at various levels including the company and user levels.

MasService.svc and MasBasicWSDL.svc are the two WSDLs that you can connect to for use. MasService.svc is for use by Microsoft Visual Studio's Service reference (WCF) and MasBasicService.svc for most other programming lanagues including PHP and ColdFusion. While I am not 100% sure if there are additional features in MasService.svc - my guess is that the available methods are the same.

The "getContractInformaiton" and "getDiagnosticInformation" action don't require any credentials. However, getDiagnosticInformation could be locked down.

Most calls require calls require you to pass the "logon" parameter. While somewhat obvious if you look through the example code- "logon" is a SINGLE parameter you pass to the web service and is a STRUCTURE (in PHP I believe this is called an Associative Array) made up of "logon.username" and "login.password". Password does not need to be encrypted and logon.username is your THREE-DIGIT username (not case-sensitive) - and apparently not the full username. Note, this concept of passing arrays/structures applies throughout the entire process of interacting with the API.

You must access the web service using HTTPS. The configuration of the SSL certificate and even the official "computer name" of the server hosting the web service must match up correctly. See Appendix B.

CompanyCode is the THREE-DIGIT code of the company file in Sage and is not case-sensitive.

When referring to a UDF we needed to actually use "UDF_SOMETHING$". Note the dollar sign which we initially thought we just a reference to a PHP variable in the docs. There were also significant issues withg making use the login user had appropriate permisions to the UDF and that the UDF was available to the API.

Though I haven't got to dealing with this yet- I have read that there are some special ways to deal with credit card numbers and dates.

For those using Adobe ColdFusion 8+ (ACF) here are some examples. I was not able to get it to work using Railo due to a known issue. Additonally, I was NOT able to get it working by manually creating the SOAP envelope (Google: "Ben Nadal SOAP") though I did not try using ACF. It initially appears that this (below) would be easier anyway. I have yet to try an update (set).

ColdFusion Tag Call:

<cfset companycode = "COM">
<cfset logon = {}>
<cfset logon.username = "USR">
<cfset logon.password = "xxxxxxx">
<cfset salesorder = "0141701">
<cftry>
<cfinvoke
webservice="https://your-domain-name.com/eBusinessWebServices/MasBasicWsdl.svc?wsdl"
method="GetSalesOrder"
returnvariable="GetSalesOrder">
<cfinvokeargument name="logon" value="#logon#"/>
<cfinvokeargument name="companycode" value="#companycode#"/>
<cfinvokeargument name="salesorderno" value="#salesorder#"/>
</cfinvoke>
<h3>
<cfoutput>#getsalesorder.getBillToAddress1()#</cfoutput>
</h3>
<cfdump var="#GetSalesOrder#">
<cfcatch>
<h2>Error</h2>
<cfoutput>
#cfcatch.detail#
</cfoutput>
</cfcatch>
</cftry>

ColdFusion Script:

<cfscript>
companycode = "COM";
logon = {};
logon.username = "USR";
logon.password = "xxxxxxx";
salesorder = "0141701";
try {
ws = CreateObject("webservice", "https://your-domain-name.com/eBusinessWebServices/MasBasicWsdl.svc?wsdl");
GetSalesOrder = ws.GetSalesOrder(logon,companycode,salesorder);
getaddress1 = getsalesorder.getBillToAddress1();
writeoutput("<h3>" & getaddress1 & "</h3>");
} catch (Any e) {
writeoutput('Error');
}
</cfscript>

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Copyright © 2015 EPhost, Inc. All rights reserved.