Forum Discussion

Wm1's avatar
4 years ago

Constant 501 Errors

Hi,


Every request to fetch data from the MYOB API is returnning a MYOB.AccountRight.SDK.ApiCommunicationException exception
I am able to refresh the access tokens, this code has been in production for a number of years,
I updated to v2021.4.334 of MYOB.AccountRight.API.SDK and this has not helped

 

Sample Code
MyobConnection connection = EstablishMyobConnection(settings);
TaxCodeService tcsService = new TaxCodeService(connection.Configuration, null, connection.Keystore);
PagedCollection<TaxCode> taxCodes = tcsService.GetRange(connection.CompanyFile, "", connection.Credentials);   <-- Error occurs here

 

 

Exception:
Message: Encountered a communication error (https://ar1.api.myob.com/accountright/e2--------------------------------d4/GeneralLedger/TaxCode/?)
I have blanked most of the GUID from the URL
RequestId: "f74da5da-2aec-415a-a1a7-ad0cb9a36aa5"

Stack Trace:
at MYOB.AccountRight.SDK.Extensions.ExceptionExtensions.ProcessException(Exception ex, Uri requestUri)
at MYOB.AccountRight.SDK.Services.ServiceBase.MakeApiGetRequestSync[T](Uri uri, ICompanyFileCredentials credentials, String eTag)
at MYOB.AccountRight.SDK.Services.ReadableRangeService`1.GetRange(CompanyFile cf, String queryString, ICompanyFileCredentials credentials, String eTag)
at Reflexion.CRM.Server.Processors.Myob.MyobArProvider.SetTaxCodes(IContext context, MyobArProcessorSettings settings, ProcessorResponse response) in D:\TFS Online\Main\Reflexion.CRM.Server.Myob\MyobArProvider.cs:line 1870

 

The Inner Exception
Message: The remote server returned an error: (501) Not Implemented.
Strack Trace:
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at MYOB.AccountRight.SDK.Communication.BaseRequestHandler.HandleResponseCallback[T,TResp](IAsyncResult asynchronousResult)

  • 365Software's avatar
    365Software
    Contributing User

    I've just seen your POST and had actually just added in one almost the same. Over the past 2 weeks teh Internal Server Errors and just poor performance of the API has been ridiculous.

  • HelenB's avatar
    HelenB
    Former Staff

    Hi Wm1 

     

    Thanks for reaching out. The error `501 not implemented` means that the AccountRight file that you are trying to use with the API has not been upgraded to the latest version of AccountRight.

    From the API logs, we can see that the file that you are using is a AccountRight 2021.1 file. This version has been decommissioned. In order to use it with the API, you will need to upgrade the AccountRight file.

     

    Thanks

    • Wm1's avatar
      Wm1

      Hi,

       

      Can you please provide some instructions on how to do this, that I can pass on to my team

       

      The version installed is, Version 2021.1.0, Build 2021.1.24.2833

       

      There is no prompt to upgrade when opening the company file

       

      Thanks