Home > Appendices > Appendix E - Integration with ServiceNow > Create REST Message
Download this articleTo invoke AvePoint Cloud Governance APIs, you must create a REST message in ServiceNow by completing the following configurations:
This is required only when you want to test the newly added AvePoint Cloud Governance API. If you don’t need to test the API, skip configurations in this section.
Complete the following steps to start creating a REST message:
Sign in to your ServiceNow instance with an account that has the admin role.
On the left navigation pane, enter REST Message in the search box, and then click REST Message in the search results.
On the REST Messages page, click New to open the REST Message – New Record page.
On the REST Message – New Record page, complete the following configurations:
Name – Enter a name for the REST API.
Endpoint – Enter ${data_center_url}/requests.
The data_center_url is a sample value, it is a variable, and you can enter a custom one. This will also be used in the next configurations.
Application – Click the Preview this record icon next to the Application field, and navigate to the Scope field on the Custom Application page. Make sure to copy this application scope to your Notepad, and it will be used in the Create System Properties and Run Script to Submit Requests sections.
Then, you need to add HTTP headers by completing the following steps:
Under the HTTP Request tab, double click the text box, enter the name and values in the Name and Value fields as listed in the table below, and then click the Save button when you finish.
| Name | Value |
|---|---|
| ClientSecret | Enter ${gao_api_clientsecret}. (This is a sample header name, and you can enter a custom name within ${xxx}.) |
| Content-Type | Enter application/json. |
| UserPrincipalName | Enter ${gao_user_name}. (This is a sample header name, and you can enter a custom name within ${xxx}.) |
After you add all HTTP headers, click Submit and you will be redirected to the REST Messages page.
Then, you need to add HTTP methods for the REST message by completing the following steps:
On the REST Messages page, click the message you’ve just created.
Navigate to the HTTP Methods field and click New to open the HTTP Method – New Record page. Then, configure the following fields:
Name – Enter a custom name for the HTTP method.
HTTP Method – Select POST from the drop-down list.
Endpoint – Enter the endpoint that this REST message is sent. The endpoint URL varies with a service type, you can refer to the endpoint URL listed in the table below for different service types:
| Service Type | Endpoint URL |
|---|---|
| Invite new guest user service | Enter ${data_center_url}/requests/createguestuser. |
| Create group/team service | Enter ${data_center_url}/requests/creategroup. |
| Change group/team service | Enter ${data_center_url}/requests/changegroup. |
| Team lifecycle management service – Restore team | Enter ${data_center_url}/requests/restoregroup. |
| Team lifecycle management service – Delete team | Enter ${data_center_url}/requests/deletegroup. |
| Team lifecycle management service – Archive team | Enter ${data_center_url}/requests/archivegroup. |
| Team lifecycle management service – Change group team site storage | Enter ${data_center_url}/requests/changegroupquota. |
| Team lifecycle management service – Change team policy | Enter ${data_center_url}/requests/changegrouppolicy. |
| Team lifecycle management – Extend team lease | Enter ${data_center_url}/requests/extendgroup. |
| Create site collection service | Enter ${data_center_url}/requests/createsite. |
| Change site collection settings service | Enter ${data_center_url}/requests/changesite/setting. |
| Site collection lifecycle management service – Delete site collection | Enter ${data_center_url}/requests/deletesite. |
| Site collection lifecycle management service – Unlock site collection | Enter ${data_center_url}/requests/unlocksite. |
| Site collection lifecycle management service – Lock site collection | Enter ${data_center_url}/requests/locksite. |
| Site collection lifecycle management service – Archive site collection | Enter ${data_center_url}/requests/archivesite. |
| Site collection lifecycle management service – Extend site collection lease | Enter ${data_center_url}/requests/extendsite. |
| Site collection lifecycle management service – Change site collection storage | Enter ${data_center_url}/requests/changesitequota. |
| Site collection lifecycle management service – Change site collection policy | Enter ${data_center_url}/requests/changesitepolicy. |
When you finish, click Submit. Then you will be redirected to the REST Message page.
To test the API you’ve just added, complete the following steps:
Navigate to the HTTP Methods field, and click the HTTP method you’ve just created.
On the HTTP Method page, navigate to the Variable Substitutions tab, and then click New to open the Variable Substitutions – New Record page.
Configure the Name and Test value fields.
Repeat the steps above to add all variable substitutions as listed in the table below:
| Name | Value |
|---|---|
| data_center_url | Enter https://go-api.avepointonlineservices.com if the AvePoint Cloud Governance environment you are using is the production environment for commercial use. Enter https://governance-api-us-gov.avepointonlineservices.com if the AvePoint Cloud Governance environment you are using is the production environment for U.S. Government Public Sector. |
| gao_api_clientsecret | Enter the client secret that you copied in the Manage API Authentication Profiles section. |
| gao_user_name | Enter the sign-in name of an AvePoint Cloud Governance user. Make sure the user has been added to AvePoint Online Services and has a subscription for AvePoint Cloud Governance. |
When you finish, click Submit. Then you will be redirected to the HTTP Method page.
Navigate to the HTTP Request tab > HTTP Query Parameters, and enter the content in the Content field. See examples below for different service types.
Click Test to test the AvePoint Cloud Governance API.
This is a sample for a Create team service request API testing.
For more information about the script, refer to the schema provided by AvePoint Cloud Governance in the AvePoint Cloud Governance API.
This is a sample for a Change team settings service request API testing.
For more information, refer to the schema provided by AvePoint Cloud Governance in AvePoint Cloud Governance API.
This is a sample content for an Invite guest user service request API testing.
For more information, refer to the schema provided by AvePoint Cloud Governance in AvePoint Cloud Governance API.
This is a sample for a Team lifecycle management service request API testing.
For more information, refer to the schema provided by AvePoint Cloud Governance in AvePoint Cloud Governance API.
Restore team
Delete team
Archive team
Extend team lease
Change group team site storage
Change team policy
This is a sample for a Create site collection service request API testing.
For more information, refer to the schema provided by AvePoint Cloud Governance in AvePoint Cloud Governance API.
This is a sample for a Change site collection settings service request API testing.
For more information, refer to the schema provided by AvePoint Cloud Governance in AvePoint Cloud Governance API.
This is a sample for a Site collection lifecycle management service request API testing.
For more information, refer to the schema provided by AvePoint Cloud Governance in AvePoint Cloud Governance API.
Unlock site collection
Lock site collection
Archive site collection
Delete site collection
Extend site collection lease
Change site collection storage
Change site collection policy
To create system properties, complete the following steps:
In your ServiceNow instance, enter System Properties in the search box on the left navigation pane, and then click Categories from the search result.
On the System Properties Categories page, click New to create a new category or edit an existing category.
On the System Property Categories – New Record page, enter the Name and Title for the category, and click Submit. Then, you will be redirected to the System Property Categories page.
Search out the category you’ve just created, and click the category name to open the category configuration page.
Navigate to the Properties field, click New to create new properties, or edit an existing property. Then configure the properties as the table below on the System Property page:
| Name | Value |
|---|---|
| x_avepo_cg_modern.gao_user_name Note that this is a sample property name. You can enter a custom name in the format of "Application scope.Header name", and: Replace the Application scope with the application scope that you copied in the REST Message Basic Information section. Replace the Header name with the header name that you configured in the Add HTTP Headers section. | Enter the sign-in name of an AvePoint Cloud Governance user. Make sure the user has been added to AvePoint Online Services and has the subscription for AvePoint Cloud Governance. |
| x_avepo_cg_modern.gao_api_clientsecret Note that this is a sample property name. You can enter a custom name in the format of "Application scope.Header name", and: Replace the Application scope with the application scope that you copied in the REST Message Basic Information section. Replace the Header name with the header name that you configured in the Add HTTP Headers section. | Enter the client secret that you copied in the Manage API Authentication Profiles section. |
| x_avepo_cg_modern.data_center_url Note that this is a sample property name. You can enter a custom name in the format of "Application scope. data_center_url", and replace the Application scope with the application scope that you copied in the REST Message Basic Information section. | Enter https://go-api.avepointonlineservices.com if the AvePoint Cloud Governance environment you are using is the production environment for commercial use. Enter https://governance-api-us-gov.avepointonlineservices.com if the AvePoint Cloud Governance environment you are using is the production environment for U.S. Government Public Sector. |