Skip to content

Commit e829a0f

Browse files
committed
Moving SharePoint Syntex API here
1 parent f6062f4 commit e829a0f

11 files changed

+1042
-0
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
title: Batch apply model
3+
ms.author: chucked
4+
author: chuckedmonson
5+
manager: pamgreen
6+
ms.reviewer: ssquires
7+
audience: admin
8+
ms.topic: reference
9+
ms.prod: microsoft-365-enterprise
10+
search.appverid:
11+
ms.collection: m365initiative-syntex
12+
ms.localizationpriority: high
13+
description: Use REST API to apply a document understanding model to one or more libraries.
14+
---
15+
16+
# Batch Apply model
17+
18+
Applies (or syncs) a trained document understanding model to one or more libraries (see [example](rest-applymodel-method.md#examples)).
19+
20+
## HTTP request
21+
22+
```HTTP
23+
POST /_api/machinelearning/publications HTTP/1.1
24+
```
25+
26+
## URI parameters
27+
28+
None
29+
30+
## Request headers
31+
32+
| Header | Value |
33+
|--------|-------|
34+
|Accept|application/json;odata=verbose|
35+
|Content-Type|application/json;odata=verbose;charset=utf-8|
36+
|x-requestdigest|The appropriate digest for current site.|
37+
38+
## Request body
39+
40+
| Name | Required | Type | Description |
41+
|--------|-------|--------|------------|
42+
|__metadata|yes|string|Set the object meta on the SPO. Always use the value: {"type": "Microsoft.Office.Server.ContentCenter.SPMachineLearningPublicationsEntityData"}.|
43+
|Publications|yes|MachineLearningPublicationEntityData[]|The collection of MachineLearningPublicationEntityData each of which specifies the model and target document library.|
44+
45+
### MachineLearningPublicationEntityData
46+
47+
| Name | Required | Type | Description |
48+
|--------|-------|--------|------------|
49+
|ModelUniqueId|yes|string|The unique ID of the model file.|
50+
|TargetSiteUrl|yes|string|The full URL of the target library site.|
51+
|TargetWebServerRelativeUrl|yes|string|The server relative URL of the web for the target library.|
52+
|TargetLibraryServerRelativeUrl|yes|string|The server relative URL of the target library.|
53+
|ViewOption|no|string|Specifies whether to set new model view as the library default.|
54+
55+
## Response
56+
57+
| Name | Type | Description|
58+
|--------|-------|------------|
59+
|201 Created||This is a customized API to support applying a model to multi document libraries. In the case of partial success, 201 created could still be returned and the caller needs to inspect the response body to understand if the model has been successfully applied to a document library.|
60+
61+
## Response Body
62+
63+
| Name | Type | Description|
64+
|--------|-------|------------|
65+
|TotalSuccesses|int|The total number of a model being successfully applied to a document library.|
66+
|TotalFailures|int|The total number of a model failing to be applied to a document library.|
67+
|Details|MachineLearningPublicationResult[]|The collection of MachineLearningPublicationResult each of which specifies the detailed result of applying the model to the document library.|
68+
69+
### MachineLearningPublicationResult
70+
71+
| Name | Type | Description|
72+
|--------|-------|------------|
73+
|StatusCode|int|The HTTP status code.|
74+
|ErrorMessage|string|The error message which tells what's wrong when apply the model to the document library.|
75+
|Publication|MachineLearningPublicationEntityData|It specifies the model info and the target document library.|
76+
77+
### MachineLearningPublicationEntityData
78+
79+
| Name | Type | Description |
80+
|--------|--------|------------|
81+
|ModelUniqueId|string|The unique ID of the model file.|
82+
|TargetSiteUrl|string|The full URL of the target library site.|
83+
|TargetWebServerRelativeUrl|string|The server relative URL of the web for the target library.|
84+
|TargetLibraryServerRelativeUrl|string|The server relative URL of the target library.|
85+
86+
## Examples
87+
88+
### Apply a model to the contracts document library in the repository site
89+
90+
In this sample, the ID of the Contoso Contract document understanding model is `7645e69d-21fb-4a24-a17a-9bdfa7cb63dc`.
91+
92+
#### Sample request
93+
94+
```HTTP
95+
{
96+
"__metadata": {
97+
"type": "Microsoft.Office.Server.ContentCenter.SPMachineLearningPublicationsEntityData"
98+
},
99+
"Publications": {
100+
"results": [
101+
{
102+
"ModelUniqueId": "7645e69d-21fb-4a24-a17a-9bdfa7cb63dc",
103+
"TargetSiteUrl": "https://contoso.sharepoint.com/sites/repository/",
104+
"TargetWebServerRelativeUrl": "/sites/repository",
105+
"TargetLibraryServerRelativeUrl": "/sites/repository/contracts",
106+
"ViewOption": "NewViewAsDefault"
107+
}
108+
]
109+
}
110+
}
111+
```
112+
113+
114+
#### Sample response
115+
116+
In the response, TotalFailures and TotalSuccesses refers to the number of failures and successes of the model being applies to the specified libraries.
117+
118+
**Status code:** 201
119+
120+
```JSON
121+
{
122+
"Details": [
123+
{
124+
"ErrorMessage": null,
125+
"Publication": {
126+
"ModelUniqueId": "7645e69d-21fb-4a24-a17a-9bdfa7cb63dc",
127+
"TargetSiteUrl": "https://contoso.sharepoint.com/sites/repository/",
128+
"TargetWebServerRelativeUrl": "/sites/repository",
129+
"TargetLibraryServerRelativeUrl": "/sites/repository/contracts",
130+
"ViewOption": "NewViewAsDefault"
131+
},
132+
"StatusCode": 201
133+
}
134+
],
135+
"TotalFailures": 0,
136+
"TotalSuccesses": 1
137+
}
138+
```
139+
140+
## See also
141+
142+
[Syntex document understanding model REST API](syntex-model-rest-api.md)
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
title: BatchDelete
3+
ms.author: chucked
4+
author: chuckedmonson
5+
manager: pamgreen
6+
ms.reviewer: ssquires
7+
audience: admin
8+
ms.topic: reference
9+
ms.prod: microsoft-365-enterprise
10+
search.appverid:
11+
ms.collection: m365initiative-syntex
12+
ms.localizationpriority: high
13+
description: Use REST API to remove an applied document understanding model from one or more libraries.
14+
---
15+
16+
# BatchDelete
17+
18+
Removes an applied document understanding model from one or more libraries. Note that a model must be removed from all libraries before it can be deleted (see [example](rest-batchdelete-method.md#examples)).
19+
20+
## HTTP request
21+
22+
```HTTP
23+
POST /_api/machinelearning/publications/batchdelete HTTP/1.1
24+
```
25+
26+
## URI parameters
27+
28+
None
29+
30+
## Request headers
31+
32+
| Header | Value |
33+
|--------|-------|
34+
|Accept|application/json;odata=verbose|
35+
|Content-Type|application/json;odata=verbose;charset=utf-8|
36+
|x-requestdigest|The appropriate digest for current site.|
37+
38+
## Request body
39+
40+
| Name | Required | Type | Description |
41+
|--------|-------|--------|------------|
42+
|Publications|yes|MachineLearningPublicationEntityData[]|The collection of MachineLearningPublicationEntityData each of which specifies the model and target document library.|
43+
44+
### MachineLearningPublicationEntityData
45+
46+
| Name | Required | Type | Description |
47+
|--------|-------|--------|------------|
48+
|ModelUniqueId|yes|string|The unique ID of the model file.|
49+
|TargetSiteUrl|yes|string|The full URL of the target library site.|
50+
|TargetWebServerRelativeUrl|yes|string|The server relative URL of the web for the target library.|
51+
|TargetLibraryServerRelativeUrl|yes|string|The server relative URL of the target library.|
52+
53+
## Response
54+
55+
| Name | Type | Description|
56+
|--------|-------|------------|
57+
|200 OK||This is a customized API to support removing a model from multi document libraries. In the case of partial success, 200 OK could still be returned and the caller needs to inspect the response body to understand if the model has been successfully removed from a document library.|
58+
59+
## Response Body
60+
61+
| Name | Type | Description|
62+
|--------|-------|------------|
63+
|TotalSuccesses|int|The total number of a model being successfully removed from a document library.|
64+
|TotalFailures|int|The total number of a model failing to be removed from a document library.|
65+
|Details|MachineLearningPublicationResult[]|The collection of MachineLearningPublicationResult each of which specifies the detailed result of removing the model from a document library.|
66+
67+
### MachineLearningPublicationResult
68+
69+
| Name | Type | Description|
70+
|--------|-------|------------|
71+
|StatusCode|int|The HTTP status code.|
72+
|ErrorMessage|string|The error message which tells what's wrong when apply the model to the document library.|
73+
|Publication|MachineLearningPublicationEntityData|It specifies the model info and the target document library.|
74+
75+
### MachineLearningPublicationEntityData
76+
77+
| Name | Type | Description |
78+
|--------|--------|------------|
79+
|ModelUniqueId|string|The unique ID of the model file.|
80+
|TargetSiteUrl|string|The full URL of the target library site.|
81+
|TargetWebServerRelativeUrl|string|The server relative URL of the web for the target library.|
82+
|TargetLibraryServerRelativeUrl|string|The server relative URL of the target library.|
83+
84+
## Examples
85+
86+
### Remove a model from the contracts document library in the repository site
87+
88+
In this sample, the ID of the Contoso Contract document understanding model is `7645e69d-21fb-4a24-a17a-9bdfa7cb63dc`.
89+
90+
#### Sample request
91+
92+
```HTTP
93+
{
94+
"publications": [
95+
{
96+
"ModelUniqueId": "7645e69d-21fb-4a24-a17a-9bdfa7cb63dc",
97+
"TargetSiteUrl": "https://constco.sharepoint-df.com/sites/docsite",
98+
"TargetWebServerRelativeUrl": "/sites/docsite ",
99+
"TargetLibraryServerRelativeUrl": "/sites/dcocsite/joedcos"
100+
}
101+
]
102+
}
103+
```
104+
105+
#### Sample response
106+
107+
In the response, TotalFailures and TotalSuccesses refer to the number of failures and successes of the model being removed from the specified libraries.
108+
109+
**Status code:** 200
110+
111+
```JSON
112+
{
113+
"Details": [
114+
{
115+
"ErrorMessage": null,
116+
"Publication": {
117+
"ModelUniqueId": "7645e69d-21fb-4a24-a17a-9bdfa7cb63dc",
118+
"TargetSiteUrl": "https://contoso.sharepoint.com/sites/repository/",
119+
"TargetWebServerRelativeUrl": "/sites/repository",
120+
"TargetLibraryServerRelativeUrl": "/sites/repository/contracts",
121+
"ViewOption": "NewViewAsDefault"
122+
},
123+
"StatusCode": 200
124+
}
125+
],
126+
"TotalFailures": 0,
127+
"TotalSuccesses": 1
128+
}
129+
```
130+
131+
## See also
132+
133+
[Syntex document understanding model REST API](syntex-model-rest-api.md)
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
title: Create file classification request
3+
ms.author: chucked
4+
author: chuckedmonson
5+
manager: pamgreen
6+
ms.reviewer: ssquires
7+
audience: admin
8+
ms.topic: reference
9+
ms.prod: microsoft-365-enterprise
10+
search.appverid:
11+
ms.collection: m365initiative-syntex
12+
ms.localizationpriority: high
13+
description: Use REST API to create a request to classify one or more files using a trained document understanding model.
14+
---
15+
16+
# Create file classification request
17+
18+
Creates a request to classify one or more files using the applied document understanding model. (For more information, see [example](rest-createclassificationrequest.md#examples).)
19+
20+
The REST service of SharePoint Online (and SharePoint 2016 and later on-premises) supports the combining of multiple requests. Requests are combined into a single call to the service by using the OData $batch query option. This method can be used to enqueue classification work items for hundreds of documents at one time.
21+
22+
## HTTP request
23+
24+
```http
25+
POST /_api/machinelearning/workItems HTTP/1.1
26+
```
27+
28+
## URI Parameters
29+
30+
None
31+
32+
## Request headers
33+
34+
| Header | Value |
35+
|--------|-------|
36+
|Accept|application/json;odata=verbose|
37+
|Content-Type|application/json;odata=verbose;charset=utf-8|
38+
|x-requestdigest|The appropriate digest for current site|
39+
40+
## Request body
41+
42+
|Name |Type |Description |
43+
|--------|-------|------------|
44+
|_metadata|string |Set the object meta on the SPO. Always use the value: {"type": "Microsoft.Office.Server.ContentCenter.SPMachineLearningWorkItemEntityData"}. |
45+
|TargetSiteId|guid|The ID of the site where the file to classify is located. This can be omitted when TargetSiteUrl has a value. |
46+
|TargetSiteUrl|string|The full URL of the site where the file to classify is located. This can be omitted when TargeSiteId has a value.|
47+
|TargetWebId|guid|The ID of the web where the file to classify is located. This can be omitted when TargetWebServerRelativeUrl has a value. |
48+
|TargetWebServerRelativeUrl|string|The server relative URL of the web where the file to classify is located. This can be omitted when TargetWebId has a value. |
49+
|TargetUniqueId|guid|The ID of the folder to classify. This can be omitted when TargetServerRelativeUrl has a value. |
50+
|TargetServerRelativeUrl|string|The server relative URL of the file to classify is located. This can be omitted when TargetUniqueId has a value.|
51+
52+
## Responses
53+
54+
| Name | Type | Description|
55+
|--------|-------|------------|
56+
|201 Created| |The response is customized. In there is failure, it could still return 201 Created. The caller should further check the response body to determine the exact result.|
57+
58+
## Examples
59+
60+
### Enqueue a request to classify a file of ID "e6cff8b7-c90c-4564-b5b8-033449090932"
61+
62+
#### Sample request
63+
64+
```JSON
65+
{
66+
"__metadata": {
67+
"type": "Microsoft.Office.Server.ContentCenter.SPMachineLearningWorkItemEntityData"
68+
},
69+
"TargetSiteId": "f686e63b-aba7-48e5-97c7-68c4c1df292f",
70+
"TargetWebId": "66d6b64d-6f88-4dd9-b3db-47e6f00c53e8",
71+
"TargetUniqueId": "e6cff8b7-c90c-4564-b5b8-033449090932"
72+
}
73+
```
74+
75+
#### Sample response
76+
77+
**Status code:** 201
78+
```JSON
79+
{
80+
"ErrorMessage": null,
81+
"StatusCode": 201
82+
}
83+
```
84+
85+
```JSON
86+
{
87+
"ErrorMessage": null,
88+
"StatusCode": 201
89+
}
90+
```
91+
92+
## See also
93+
94+
[Syntex document understanding model REST API](syntex-model-rest-api.md)

0 commit comments

Comments
 (0)