You can use web services to search for, delete, reindex and reset entries in the cockpit and documents.
In many cases, the web services are useful tools for quickly analyzing edoc archivelink, e.g. after a move or in the event of problems. If necessary, you can easily carry out the necessary steps using the web services.
Things to know
You must authorize each web service with an access token, the client ID and the client secret.
The following web services are available as URLs in your Microsoft Dynamics 365 for Finance and Operations environment:
-
Update: https://<Base_address> /api/services/EDARLProcessingServiceGroup/EDARLProcessingService/updateDocuTableOperation
-
Delete: https://<Base_address> /api/services/EDARLProcessingServiceGroup/EDARLProcessingService/deleteOperation
-
Search: https://<Base_address> /api/services/EDARLProcessingServiceGroup/EDARLProcessingService/findCockpitDataOperation
-
Reindex and reset: https://<Base_address> /api/services/EDARLProcessingServiceGroup/EDARLProcessingService/reindexAndResetOperation
Available parameters for the search using web services
You can use the following search parameters in the web services:
-
DocuId (ID of the document in Dynamics 365 for Finance and Operations)
-
ECMDocuId (ID of the ECM document)
-
DocuTypeId (ID of the document type)
-
SystemId (ID of the ECM system in edoc archivelink)
-
RepositoryId (ID of the ECM repository)
-
ProcessingType (processing type in edoc archivelink)
-
ProcessingStatus (processing status in edoc archivelink)
-
CreatedDateTimeFrom (creation date in edoc archivelink)
-
CreatedDateTimeTo (time of creation in edoc archivelink)
Note the time zone of the cloud server
If you use the CreatedDateTimeFrom and CreatedDateTimeTo search parameters, be sure to check in advance in which time zone your cloud server is located.
Depending on the location, there may be a time difference of one hour or several hours. In this case, adjust the time in the search parameters accordingly.
Available parameters for updating and deleting using web services
You can update two document properties and their fields:
-
ECM document ID: Only if the property is empty. Prerequisite: The document ID already exists. Both fields are sent as parameters.
-
Description: Is the detailed description of the document.
-
Document fields: You need the indexing definition to update the fields. The status of the entry is set to Waiting in the cockpit after updating.
First check entries before deleting them. Use the search web service to evaluate and check the entries that could potentially be deleted.
Code examples for the various web services
You can use any REST API tool for your purposes. One useful tool is Postman, for example, which you can use to specify your queries in JSON format. In the following examples, you will find the Postman queries in JSON format.
Web service for searching for entries in the cockpit (sample query)
The URL for a search for entries in the cockpit contains the following elements: https://<Base_address>/api/services/<Service group>/<Service class>/<Function>
Example: https://<Base_address>/api/services/EDARLProcessingServiceGroup/EDARLProcessingService/findCockpitDataOperation
{
"_requestContract":
{
"Lines":[
{
"CreatedDateTimeFrom":"21.11.2023 09:56:01",
"CreatedDateTimeTo":"21.11.2023 09:56:05",
"DocuId": "<Document_ID_in_Dynamics>",
"ECMDocuId": "<Name_ECM_Document>",
"DocuTypeId": "<Name_Document_Type>",
"SystemId": "<ECM_System_ID>",
"RepositoryId": "<ECM_Repository_ID>",
"ProcessingType": "<Processing_Type_Name>",
"ProcessingStatus": "<Status_Name>",
}
]
}
}
Web service for deleting entries in the cockpit (sample query)
The URL for deleting entries in the Cockpit contains the following elements: https://<Base_address>/api/services/<Service group>/<Service class>/<Function>
Example: https://<Base_address>/api/services/EDARLProcessingServiceGroup/EDARLProcessingService/deleteOperation
{
"_requestContract":
{
"Lines":[
{
"ProcessingType":"<Processing_Type_Name>",
"ProcessingStatus":"<Status_Name>"
}
]
}
}
Web service for updating entries in the cockpit (sample query)
The URL for updating entries in the cockpit contains the following elements: https://<Base_address>/api/services/<Service group>/<Service class>/<Function>
Example: https://<Base_address>/api/services/EDARLProcessingServiceGroup/EDARLProcessingService/updateDocuTableOperation
If you want to update several ECM document IDs, you can do the following:
{
"_requestContract":
{
"Lines":[
{
"ECMDocuId":"<Name_ECM_Document_1>",
"DocuId":"<Document_ID_in_Dynamics_1>",
"Description":"<Description_for_ECM_Document_1>"
},
{
"ECMDocuId":"<Name_ECM_Document_2>",
"DocuId":"<Document_ID_in_Dynamics_2>",
"Description":"<Description_for_ECM_Document_2>"
}
]
}
}
You can also overwrite the ECM document ID with the updateDocuTableOperation web service. By default, only empty fields are taken into account.
You can overwrite an existing ECM document ID with the parameter overwriteECMDocuId = Yes.
If you want to update an existing ECM document ID, you can do the following:
{
"_requestContract":
{
"Lines":[
{
"ECMDocuId":"<Name_ECM_Document_2>",
"DocuId":"<Document_ID_in_Dynamics_2>",
"overwriteECMDocuId":"Yes",
"Description":"<Description_for_ECM_Document_2>"
}
]
}
}
Web service for reindexing and resetting entries in the cockpit (sample query)
The URL for reindexing and resetting entries in the cockpit contains the following elements: https://<Base_address>/api/services/<Service group>/<Service class>/<Function>
Example: https://<Base_address>/api/services/EDARLProcessingServiceGroup/EDARLProcessingService/reindexAndResetOperation
{
"_requestContract":
{
"Lines":[
{
"ECMDocuId":"<Name_ECM_Document_1>",
"DocuId":"<Document_ID_in_Dynamics_1>",
"IndexDefId":"<Index_Definition_ECM_Document_1>"
}
]
}
}
Tips for setting up access permission in Postman
If you want to use Postman as a REST API tool, for example, you must authorize yourself accordingly with an access token, the client ID and the client secret.
Here's how
-
First create a collection.
-
Log in to your Dynamics 265 instance by creating a request of the type Post: https://login.microsoftonline.com/<Tenant-ID>/oauth2/token.
-
Enter the corresponding data for client_id, client_secret, resource, and grant_type in the Body section under x-www-form-urlencoded.
-
Create further requests of type Post for the web services with the link: https://<Base_address>/api/services/EDARLProcessingServiceGroup/EDARLProcessingService/<Name_of_the_web_service.
-
Specify raw and JSON parameters under Body.
-
Enter the script in the editor.
Once you have completed authorization, you will find the generated token under Authorization in the first request. Enter the token in each request for each web service under Authorization.