This post will be a catalogue of errors I’ve had interacting with the MYOB Exo API, and how to resolve them.
Code: Unable to load ModuleSecurity for ‘appid=4400’
Appears: Error appears when doing any requests apart from discovery.
Meaning: The module ‘4400’ is unlicensed. 4400 is the API.
Resolution: Make sure the API License is loaded in Exo Config. If you don’t have one, contact your business partner.
Code: “An error has occurred.”
Appears: Can appear anywhere.
Meaning: Indicates either Business Logic or Database failure with the data sent through.
Resolution: Most commonly appears if trying to submit a description that is too long. Older Exo databases have a 40 character maximum for Description fields, which was increased in 2018.5 to 100 characters by default. Both database tables AND a hidden profile in Exo Config need to be updated to enable longer description lengths. Similar problems can appear with Addresses.
Check for Truncation errors as your first port of call. Otherwise, get the Business Partner involved and send them a copy of the packet.
Symptom: API unable to connect via LiveRelay service. (Especially if works via Local API connections.
Appears: On any API call via appropriate service.
Example Code: (.NET example)
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IO
Exception: Authentication failed because the remote party has closed the transport stream.
at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
Meaning: You’re attempting to access the LiveRelay service
Resolution: Force your code to use TLS 1.1 or above. For .NET/Powershell this can be done by:
Upgrading to Powershell 6.
Upgrading to .NET 4.6.1
Adding this line to your code:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Symptom: API Discovery endpoint works, but attempts to use any other endpoint return no information. Especially via LiveRelay.
Appears: Can appear anywhere.
Meaning: The user did not authenticate properly, and no data was returned.
Resolution: When experienced, the API user was using a valid API Token, and a validly hashed Username/Password combination, however the User had been removed from the staff table. (Test database had been overwritten and user hadn’t exist in live database.) Adding the user again and reissuing an ExoToken worked, so suspect this is the resolution generally for this kind of problem.