Get Started

You can refer to the sections below to get started.

Register an AvePoint App

Before using the APIs, you must register an app in AvePoint Online Services > Administration > App registrations and grant permissions to the app. With the registered app, you can use the generated application (client) ID for authentication.

Refer to the following URLs to access the page where you can register the app.

Refer to the Configure App Registrations for detailed instructions on how to register an app.

Get the Access Token

Once you have the application (client) ID, get the access token via the application (client) ID to authenticate with AvePoint Opus APIs.

The following information is required to get an access token:

ElementDescription
Identity Service Addresshttps://identity.avepointonlineservices.com (Commercial); https://identity-gov.avepointonlineservices.com (U.S. Government)
AOSAppClientIDThe application (client) ID you have retrieved.
ConnectorCertificateThumbprintThe thumbprint of the .pfx certificate file of the .cer certificate you used when registering the AvePoint app.
ConnectorScopeThe permissions you have granted to the AvePoint app. For AvePoint Opus, the scope is records.readwrite.all.

To get the access token using the above information, create a JSON Web token using the Client ID and certificate first, and then use the JSON Web token to request an access token of the defined scope from AOS Identity Service.

Below is an example of getting the access token.

private static readonly string _IdentityServerAddress = "https://identity.avepointonlineservices.com";
// private static readonly string _AosAppClientId = " ";

private static readonly string _ConnectorCertificateThumbprint = " ";

private static readonly string _ConnectorScope = "records.readwrite.all";

private void SendRquest() 

{    
var accessToken = GetAccessToken();

var requestUrl = "SubmitRecords POST URL";

var parameter = "SubmitRecords Parameter";

var reponse = WebUtil.SendRequestForIds("Post", requestUrl, accessToken, JsonConvert.SerializeObject(parameter));
}

private string GetAccessToken() 

{   
    var httpClient = new HttpClient();

    var disco = await httpClient.GetDiscoveryDocumentAsync(IdentityServerAddress);
    
        var request = new ClientCredentialsTokenRequest<br>    
        
        {     
              Address = disco.TokenEndpoint,
        
              ClientAssertion = new ClientAssertion        
              
              {           
                    Type = OidcConstants.ClientAssertionTypes.JwtBearer,
              
                    Value = CreateClientAuthJwt(disco, tenantId)
                          
                                  },
                                  
                                          Scope = _ConnectorScope,    
                                          };
                                          
                                              var tokenResponse = await httpClient.RequestClientCredentialsTokenAsync(request);
                                              
                                                  return tokenResponse.AccessToken;
                                                  }
                                                  
private string CreateClientAuthJwt(DiscoveryDocumentResponse response)
                                                  
{    
    var tokenHandler = new JwtSecurityTokenHandler { TokenLifetimeInMinutes = 10 };
                                                  
    var subject = new ClaimsIdentity(new List<Claim>    
                                                      
            {        new Claim("sub", IdentityServerClientId),        new Claim("jti", Guid.NewGuid().ToString()),    });
                                                      
    var securityToken = tokenHandler.CreateJwtSecurityToken(        issuer: _AosAppClientId,        audience: response.TokenEndpoint,        subject: subject,        signingCredentials: new SigningCredentials(new X509SecurityKey(GetCertificate(_ConnectorCertificateThumbprint)), "RS256")    );
            return tokenHandler.WriteToken(securityToken)
}

The token you get will expire in one hour, and you need to get the token again after the expiration.

API URL

When you use the AvePoint Opus API, you will need the API URL. The API URL varies with your data center. Choose the API URL according to your data center.

InfrastructureData CenterWeb API URL
Microsoft AzureAustralia Southeast (Victoria)https://graph-au.avepointonlineservices.com/records
Microsoft AzureCanada Central (Toronto)https://graph-ca.avepointonlineservices.com/records
Microsoft AzureGermany West Central (Frankfurt)https://graph-de.avepointonlineservices.com/records
Microsoft AzureEast US (Virginia)https://graph-us.avepointonlineservices.com/records
Microsoft AzureJapan West (Osaka)https://graph-jp.avepointonlineservices.com/records
Microsoft AzureNorth Europe (Ireland)https://graph-ne.avepointonlineservices.com/records
Microsoft AzureSoutheast Asia (Singapore)https://graph-sg.avepointonlineservices.com/records
Microsoft AzureSwitzerland North (Zurich)https://graph-ch.avepointonlineservices.com/records
Microsoft AzureUK South (London)https://graph-uk.avepointonlineservices.com/records
Microsoft AzureUS Gov Virginia (Virginia)https://graph-gov.avepointonlineservices.com/records
Microsoft AzureWest Europe (Netherlands)https://graph-we.avepointonlineservices.com/records
Microsoft AzureFrance Central (Paris)https://graph-fr.avepointonlineservices.com/records
Microsoft AzureKorea Central (Seoul)https://graph-kr.avepointonlineservices.com/records
Google Cloud PlatformGCP for Australia Southeast (Sydney)https://graph-gcp-au.avepointonlineservices.com/records
Google Cloud PlatformGCP for Japan (Tokyo)https://graph-gcp-jp.avepointonlineservices.com/records
Google Cloud PlatformGCP for East US (Moncks Corner)https://graph-gcp-us.avepointonlineservices.com/records
Google Cloud PlatformGCP for West Europe (Eemshaven, Netherlands)https://graph-gcp-we.avepointonlineservices.com/records
Google Cloud PlatformGCP for South Korea (Seoul)https://graph-gcp-kr.avepointonlineservices.com/records