Forum Discussion
Have you got the access token? Hamishjam
I have not used the class that was uploaded by John_Dinning so I cannot comment on whether it works or not but I have built my own class to get the access token
maybe that was why the class was removed from the online sample but like I said I have not tried using it..
If you have the access token then just create a SimpleOAuthKeyService and assign the values from the token to it and you should be able to run the following.
let me know how you get on. If I have time I'll build a test harness and upload it to github for others that are stuck here...seriously considering leaving the .NET SDK and just using RestSharp/HttpClient to access the API
var keystore = new SimpleOAuthKeyService();
keystore.OAuthResponse = new OAuthTokens
{
AccessToken = myobTokens.AccessToken,
ExpiresIn = int.Parse(myobTokens.ExpiresIn),
ReceivedTime = myobTokens.TokenTime,
RefreshToken = myobTokens.RefreshToken,
Scope = myobTokens.Scope,
TokenType = myobTokens.TokenType
};
// Get Company Files
var cfService = new CompanyFileService(configuration, null, keystore);
var companies = cfService.GetRange();
foreach (var company in companies)
{
System.Console.WriteLine(company.Name);
Debug.WriteLine(company.Name);
}
Hi kjm , there have been some recent changes to API support. For developer support, please see https://apisupport.myob.com/hc/en-us/requests/new?ticket_form_id=215283
The email address developers@myob.com has been retired.
Also see https://apisupport.myob.com/hc/en-us/articles/5139088196751-Developer-Update-July-2022 for a summary of changes to API support.
There is no specific statement around online/forum support.
- kjm3 years agoTrusted Cover User
- The_Doc3 years agoUltimate Cover User
Hi kjm
Even though I am a C#.NET, VB.NET programmer I decided long ago NOT to use the SDK - just long experience with MYOB.
I designed my own - using MS Access VBA - and they work almost without problem - but the problem isn't usually the API. And they just work.
However, now I need this code in VC#.NET - hmm guess I got to go for writing my own code in C# - which shouldn't be a problem as the nitty gritty of getting it all working in VBA is long ago worked out.
I get very few API errors - but mainly if I do they are timeouts and I just recycle.
The Doc
Looking for something else?
Search the Community Forum for answers or find your topic and get the conversation started!
Find technical support and help for all MYOB products in our online help centre
Dig into MYOB Academy for free courses, learning paths and live events to help build your business with MYOB.