Home > Appendices > API for Connector
Export to PDF*Note: We are in the process of upgrading to new APIs to enhance user experience, improve stability, and facilitate easier integration. Visit our documentation page for additional details.
AvePoint Opus offers APIs to import data from additional systems beyond the built-in content sources, as well as File System and SharePoint On-Premises connected via agents. It also enables the export of records with specific disposal due date and updates their status to Disposed within AvePoint Opus.
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:
| Element | Description |
|---|---|
| Identity Service Address | The Identity Service Address:● https://identity.avepointonlineservices.com (Commercial)● https://identity-gov.avepointonlineservices.com (U.S. Government) |
| AOSAppClientID | The application (client) ID you have retrieved. |
| ConnectorCertificateThumbprint | The thumbprint of the .pfx certificate file of the .cer certificate you used when registering the AvePoint app. |
| ConnectorScope | The 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 { 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 { 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);} |
|---|
*Note: 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.
The following sections list the supported APIs.
POST api/connector/SubmitRecords
Submit records to AvePoint Opus. You need to download the JSON file of each connection from Settings > Connector to prepare the record information.
*Note: You can only submit up to 15 records at a time.
Example
| { "id": " ", "confilictOption": "Overwrite", "data": [ { "rowKey": "SingleText", "leafName": "SingleText", "termFullPath": "Taxonomy", "timeCreated": "DateTime", "timeModified": "DateTime", "createdBy": "SingleText", "modifiedBy": "SingleText", "Multiple%20_Text_%20_Column": "MultipleText", "DateTime%20_Column": "DateTime", "Single%20_Choice_%20_Column": "SingleChoice", "Multiple%20_Choice_%20_Column": "MultipleChoice", "People%20_or_%20_Group_%20_Column": "PeopleOrGroup", "Number%20_Column": "Number" } ] } |
|---|
Request Information
| Element | Description | Type | Required |
|---|---|---|---|
| id | The ID of the connection. | GUID | Yes |
| conflictOption | The conflict resolution when there are records with the same unique key.Valid values are:Overwrite to overwrite the record information in AvePoint Opus.Skip to skip submitting the record to AvePoint Opus. | String | Yes |
| rowKey | The unique key of the record. | String | Yes |
| leafName | The internal name of the built-in Name column in the connection. | String | Yes |
| termFullPath | The internal name of the built-in Classification column in the connection.The value must be the full path of a term in AvePoint Opus. | String | No |
| timeCreated | The internal name of the built-in Created time column in the connection.The format of the value must follow the date and time format configured in Settings > General settings. | String | Yes |
| timeModified | The internal name of the built-in Modified time column in the connection. | String | Yes |
| createdBy | The internal name of the built-in Created by column in the connection. | String | No |
| modifiedBy | The internal name of the built-in Modified by column in the connection. | String | No |
*Note: AvePoint Opus supports creating custom columns of different types to meet your requirements for variable record properties. When submitting records with custom columns, enter the internal name of each custom column you have defined in the connection. Values of custom columns are optional. For details, refer to Create a Connection.
Response Information
| Element | Description | Type |
|---|---|---|
| Message | The request details. | String |
| FailedItems | If some records failed to be submitted to AvePoint Opus, this parameter would appear, displaying the records failed in the request.The value contains:Item is the information of the item that failed in the request.Message is the details about the failure. | Array (Object) |
POST api/connector/GetDueRecords
Retrieve the records whose disposed due date is earlier than the specified time.
Example
| { id: " ", disposalDueDate: 2024-04-01 00:59:34, startIndex: "", itemsPerPage: 15, } |
|---|
Request Information
| Element | Description | Type | Required |
|---|---|---|---|
| id | The ID of the connection. | GUID | Yes |
| disposalDueDate | The disposal due date.The format of the value must follow the date and time format configured in AvePoint Opus > Settings > General settings. | String | Yes |
| startIndex | The page index of the last request. | String | No |
| itemsPerPage | The number of records that you want to request on one page.The valid value is a number between 0 and 100. | Int | Yes |
Response Information
| Element | Description | Type |
|---|---|---|
| message | The details about the action. | String |
| pageIndex | The page index of the records that are queried in the request. | String |
| queriedItems | The records that match the request information. | Array |
Update the status of records as Destroyed in AvePoint Opus.
Note the following:
Example
| { disposalIds: ["Item RowKey1","Item RowKey2"]} |
|---|
Request Information
| Element | Description | Type | Required |
|---|---|---|---|
| Item RowKey | The unique ID of the record that you want to update as Destroyed in AvePoint Opus. | String | Yes |
Response Information
| Element | Description | Type |
|---|---|---|
| message | The request details. | String |
| failedItems | The items that failed in the request. | Array (["Row Key1", "Row Key2"]) |