Forum Discussion

Insulagroup's avatar
4 years ago
Solved

Timeouts and retry options on AccountRight .NET SDK

Hi,

We are using AccountRight .NET SDK (v 2018.1.144) for our integration jobs where we insert/update records on MYOB company files (contacts, projects, invoices, claims etc.) with our client data and time to time we noticed the MYOB API calls failing internally with "500 Internal Server Error" which are due to communication/connection failures on MYOB API. 

e.g. "(https://ar1.api.myob.com/accountright/d099d651-f49a-405e-9e10-5f0e2f3dd9d4/Purchase/Order/Service/?$filter= Number eq 'W185954') ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error."

 

Just wondering whether there are built in facilities on the SDK to apply a timeout and specially to go for a predefined number of retries before simply throwing the above exception ?

 

Thanks

Dinesh (Insula Group)

  • Mike_James's avatar
    Mike_James
    4 years ago

    Hi Insulagroup , we have a similar situation with a 2-way integration that runs (mostly) unattended, and my comments are as follows:

    - there is no 'retry' option within the SDK

    - you will have to add that function to your app

    - include x-myobapi-requestid=<guid> in your header (create your own guid)

    - most 500 errors go through on the 2nd attempt, the worst I've ever seen (so far) is the 4th attempt

    - we maintain a trace log of all API errors (including all the details required by the API team) as evidence we can forward to the developers if necessary.

     

    The API team have been very helpful to date, there was a recent upgrade to the API infrastructure, but we still see these errors occasionally.

     

     

     

     

4 Replies

Replies have been turned off for this discussion
  • HelenB's avatar
    HelenB
    MYOB Moderator

    Hi Insulagroup 

     

    Thanks for reaching out. Firstly I've noticed that you are using an old verison of the .NET SDK. We recommend that you upgrade to the latest which is 2020.209.0-rc1. This is available to download from the NuGet Gallery here.

     

    As for the 500 errors that you are receving, we recommend that you capture the request_id and then send it through to the API Support Team with the timestamp of when the request occured. The API Support Team will be able to provide more details on the 500 error's that you are seeing.

    To capture the request_id using the .NET SDK, check out this link Here. Then you can log a ticket with the API Support Team by using this Link Here

     

    • Insulagroup's avatar
      Insulagroup
      Partner

      Hi HelenB ,

       

      Thanks for your prompt response.

      Yes I have already upgraded the AccountRight .NET SDK version to the latest to avoid any issues with the older version as well as expecting the new version should be more robust with features etc.

       

      Re: 500 errors, we can try adding in the functionality to record the request_ids as you have suggested, but the concern here is our tool is an automated integration tool that runs daily basis without any manual intervention to integrate client data from/to our databases, therefore we were expecting to implement a 'retrying' feature into our tool so that we can retry the same request on MYOB a predefined number of times before marking the whole integration process as failed - which is what the clients complain was.

       

      Therefore the primary requirement here was not to dig into the details on why it got failed, but to add in a retrying attempt to our client code. We can definitely go for the option of recording all the failing request_ids and send it to MYOB, but we were after implementing the retry feature first to add bit more reliability to our system and if it still fails we can dig into details. 

       

      Therefore, my request was to get some info from MYOB on whether the SDK has got any builtin feature for retrying API requests. 

       

      Thanks & regards,

      Dinesh

       

       

       

       

       

       

       

      • Mike_James's avatar
        Mike_James
        Ultimate Partner

        Hi Insulagroup , we have a similar situation with a 2-way integration that runs (mostly) unattended, and my comments are as follows:

        - there is no 'retry' option within the SDK

        - you will have to add that function to your app

        - include x-myobapi-requestid=<guid> in your header (create your own guid)

        - most 500 errors go through on the 2nd attempt, the worst I've ever seen (so far) is the 4th attempt

        - we maintain a trace log of all API errors (including all the details required by the API team) as evidence we can forward to the developers if necessary.

         

        The API team have been very helpful to date, there was a recent upgrade to the API infrastructure, but we still see these errors occasionally.