Forum Discussion

kirsten's avatar
kirsten
Experienced User
1 month ago

MYOB.AccountRight.SDK.ApiValidationException 400 Bad request https://secure.myob.com/oauth2/v1/authorize

Has something happened to the above url recently?

 

I am using the SDK

The following code fails on the await.

 

 

        public async t.Task<CompanyFile[]> GetCompanyFiles(ApiConfiguration configuration, IOAuthKeyService authKeyService)
        {
            var cfsCloud = new CompanyFileService(configuration, null, authKeyService);
            // Await the SDK call and avoid capturing the UI context to prevent deadlocks
            return await cfsCloud.GetRangeAsync().ConfigureAwait(false);
        }

2 Replies

  • Isaiah_C's avatar
    Isaiah_C
    MYOB Moderator
    1 month ago

    Hi kirsten,

     

    Thanks for sharing the details. That error is definitely a tricky one. Hopefully someone from the community who's run into this before can jump in with some insight. If not, your best bet would be to reach out directly to the support team via developer.myob.com.

     

    Regards,

    Sai 

  • kirsten's avatar
    kirsten
    Experienced User
    1 month ago

    Thank you for the empathy Sai
    I got it working again with help from copilot telling me to separate getting the code from getting the company files