How to Authenticate MYOB API and Get Data in Php

Myob is popular accounting software of Australia and New Zealand. Its provides tax, accounting and other service to small and medium businesses.

Lets get started with MYOB api authentication process. To access all accounting data outside, you need to authenticate it via account credential.

To authenticate with MYOB api, you need Client ID and Secret key. Use scope as CompanyFIle and grant type as authorization_code.

Steps to Get Myob API Authentication

Step 1: Getting Code to get access token to authenticate api call. Save below code in get-data.php file.

Step 2: After this file hit on server, you will get the code which is use for get the access token.

Use below authenticate.php to generate the token. In this file use your Myob Accountright file access credential.

After this process you have access token, but this token will expire after some time. So if you want to use API call repeatedly, than must use Refresh Token method.

This will generate new access token every time using created Refresh Token. In this way, no need to authenticate it via account login credential again an again.

Leave a Comment