MYOBCommunity
Partner Zone
|
|
Partner Zone

403 Forbidden when trying to access cloud based company file

3 REPLIES
Partner Rizwan46
3 Posts
Partner
Rizwan46
Partner

3Posts

0Kudos

0Solutions

Re: 403 Forbidden when trying to access cloud based company file

Hi Jack,


My Developer keys somehow were not active in that case. Helen activated them and I got through.

 

Thanks

MYOB Staff Post DeveloperJack
141 Posts
MYOB Staff Post
Australia
DeveloperJack
MYOB Staff Post

141Posts

30Kudos

21Solutions

Accepted Solution Solved Solution

Re: 403 Forbidden when trying to access cloud based company file

Hi there @Rizwan46,

I can see we have an open support ticket for you where we'll continue to assist.

 

For the benefit of anyone else reading this thread, a 403 error is most commonly down to the API key. It happens when the key is missing from the headers or if the key is inactive. You can reach out to developers@myob.com if new keys you create require activation.

 

Oauth2 is a required process (it cannot be skipped) however it is a one-time setup where you can use the refresh tokens for ongoing access. As a result, you can set up your Oauth2 code to run as a configuration or setup screen and store tokens securely for your background 'headless' process to run.

 

Cheers,

Jack

Jack Skinner
MYOBapi Evangelist

Are you a developer? Check out http://developer.myob.com
Looking for an Add-on? Check out http://myob.com/addons/
Partner arvin
1 Post
Partner
Australia
arvin
Partner

1Posts

0Kudos

0Solutions

Re: 403 Forbidden when trying to access cloud based company file

Found solution?

Partner Rizwan46
3 Posts
Partner
Rizwan46
Partner

3Posts

0Kudos

0Solutions

Solved: Go to Solution

403 Forbidden when trying to access cloud based company file

Hi everyone,

 

I am new to MYOB development and I am facing many issues. I am not able to access company flie using the sample C# code as in below:-

 

var configuration = new ApiConfiguration(DeveloperKey, DeveloperSecret, "http://desktop");

                var oauthService = new OAuthService(configuration);

 

                var tokens = oauthService.GetTokens(OAuthLogin.GetAuthorizationCode(configuration));

                var keystore = new SimpleOAuthKeyService();

                keystore.OAuthResponse = tokens;

 

                //tokens = oauthService.RenewTokens(keystore.OAuthResponse);

 

                // Get Company Files

                var cfService = new CompanyFileService(configuration, null, keystore);

                var companyFiles = cfService.GetRange();

 

I get a 403- Forbidden issue when trying to Get files from cloud? any idea?

Apart from the above I would like to know:-

Is it possible to get auth code and auth tokens withouth actually using a web browser interface as I want to get both from backed (no login/user intervention required).

 

Many Thanks in Advance

 

 

Didn't find your answer here?
Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post