Authorizing Avaza APIs in Astera Centerprise¶
The Avaza API follows REST protocol with ‘OAuth2’ authentication. It allows you to access contacts, projects, tasks, invoices and taxes. In Astera Centerprise, you can configure an Avaza API through a swagger definition using the Import API option in REST API Browser.
Let’s go over how we can authenticate an Avaza API in Astera Centerprise.
1. Create an integration project by going to Project > New > Integration Project.
2. To import Avaza API in your Centerprise client, click on the following icon.
3. An Import API window will open where you need to select your relevant import source. In this case, we will import using the Json/Yml Url source.
Base URL: https://api.avaza.com/swagger/docs/v1
You will see that all the APIs present on Avaza’s URL have been populated in the REST API Browser (Beta).
4. Now, you need to authenticate the Avaza APIs to be able to use them in your dataflow. Without authentication, you will get an error. To authenticate an API, go to the Project Explorer and double click on the API’s .sact file under the Shared Connection node.
The Avaza .sact file will open on the designer. Now, right click on shared action file’s header and select Properties.
5. This will open the REST API Connection window where you can configure settings to authenticate Avaza API.
Avaza uses ‘OAuth 2’ authentication. In the ‘OAuth 2’ Security Type, select one from the following Grant Type options:
- Authorization Code
In this case, we will be using the ‘Authorization Code’.
Note: Login to your Avaza account and go to Settings > Developer Apps > Add OAuth App to generate the ClientID and Client Secret.
Auth Url: https://any.avaza.com/oauth2/authorize
Access Token Url: https://any.avaza.com/oauth2/token
6. Now click on Request token to generate access token and refresh token for Avaza.
Note: As you click on Request Token, Avaza’s authorization app will open where you will be required to provide your credentials to be able to generate access token and refresh token to access Avaza.
7. Save the shared action file after authentication and you are ready to use Avaza APIs in Centerprise.
This concludes authenticating the Avaza APIs in Astera Centerprise.