创建 inboundFlow
本文内容
命名空间:microsoft.graph.industryData
重要
Microsoft Graph 中版本下的 /beta
API 可能会更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 在 v1.0 中是否可用,请使用 版本 选择器。
创建新的 inboundFlow 对象。
创建 inboundFlow 时,需要以下先决条件资源:
权限
调用此 API 需要以下权限之一。 若要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
IndustryData-InboundFlow.ReadWrite.All
委派(个人 Microsoft 帐户)
不支持。
应用程序
IndustryData-InboundFlow.ReadWrite.All
HTTP 请求
POST /external/industryData/inboundFlows
名称
说明
Authorization
持有者 {token}。 必填。
Content-Type
application/json. 必需。
请求正文
在请求正文中,提供 microsoft.graph.industryData.inboundFlow 对象的 JSON 表示形式。
创建 inboundFlow 时,可以指定以下属性。
属性
类型
说明
dataDomain
microsoft.graph.industryData.inboundDomain
此流导入的数据的广泛类别。 可能的值为: educationRostering
、 unknownFutureValue
。 必填。
displayName
String
进程的名称。 继承自 industryDataActivity 。 必填。
effectiveDateTime
DateTimeOffset
允许流运行的时间窗口的开始时间。 时间戳类型表示采用 ISO 8601 格式的日期和时间信息,始终采用 UTC 时区。 例如,2014 年 1 月 1 日午夜 UTC 为 2014-01-01T00:00:00Z
。 必需。
expirationDateTime
DateTimeOffset
允许流运行的时间窗口的结束时间。 时间戳类型表示采用 ISO 8601 格式的日期和时间信息,始终采用 UTC 时区。 例如,2014 年 1 月 1 日午夜 UTC 为 2014-01-01T00:00:00Z
。 可选。
响应
如果成功,此方法在 201 Created
响应正文中返回响应代码和 microsoft.graph.industryData.inboundFlow 对象。
示例
请求
请求示例如下所示。
POST https://graph.microsoft.com/beta/external/industryData/inboundFlows
Content-Type: application/json
Content-length: 246
{
"@odata.type": "#microsoft.graph.industryData.inboundFileFlow",
"dataConnector@odata.bind": "https://graph.microsoft.com/beta/external/industryData/dataConnectors/51dca0a0-85f6-4478-f526-08daddab2271",
"dataDomain": "educationRostering",
"displayName": "Inbound rostering flow",
"effectiveDateTime": "2023-03-12T16:40:46.924769+05:30",
"expirationDateTime": "2023-03-13T16:40:46.924769+05:30",
"year@odata.bind": "https://graph.microsoft.com/beta/external/industryData/years/ebf18762-ab92-487e-21d1-08daddab28bb"
}
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Beta.Models.IndustryData.InboundFlow
{
OdataType = "#microsoft.graph.industryData.inboundFileFlow",
DataDomain = Microsoft.Graph.Beta.Models.IndustryData.InboundDomain.EducationRostering,
DisplayName = "Inbound rostering flow",
EffectiveDateTime = DateTimeOffset.Parse("2023-03-12T16:40:46.924769+05:30"),
ExpirationDateTime = DateTimeOffset.Parse("2023-03-13T16:40:46.924769+05:30"),
AdditionalData = new Dictionary<string, object>
{
{
"dataConnector@odata.bind" , "https://graph.microsoft.com/beta/external/industryData/dataConnectors/51dca0a0-85f6-4478-f526-08daddab2271"
},
{
"year@odata.bind" , "https://graph.microsoft.com/beta/external/industryData/years/ebf18762-ab92-487e-21d1-08daddab28bb"
},
},
};
var result = await graphClient.External.IndustryData.InboundFlows.PostAsync(requestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const inboundFlow = {
'@odata.type': '#microsoft.graph.industryData.inboundFileFlow',
'dataConnector@odata.bind': 'https://graph.microsoft.com/beta/external/industryData/dataConnectors/51dca0a0-85f6-4478-f526-08daddab2271',
dataDomain: 'educationRostering',
displayName: 'Inbound rostering flow',
effectiveDateTime: '2023-03-12T16:40:46.924769+05:30',
expirationDateTime: '2023-03-13T16:40:46.924769+05:30',
'year@odata.bind': 'https://graph.microsoft.com/beta/external/industryData/years/ebf18762-ab92-487e-21d1-08daddab28bb'
};
await client.api('/external/industryData/inboundFlows')
.version('beta')
.post(inboundFlow);
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
InboundFileFlow inboundFlow = new InboundFileFlow();
inboundFlow.additionalDataManager().put("dataConnector@odata.bind", new JsonPrimitive("https://graph.microsoft.com/beta/external/industryData/dataConnectors/51dca0a0-85f6-4478-f526-08daddab2271"));
inboundFlow.dataDomain = InboundDomain.EDUCATION_ROSTERING;
inboundFlow.displayName = "Inbound rostering flow";
inboundFlow.effectiveDateTime = OffsetDateTimeSerializer.deserialize("2023-03-12T11:10:46.924769+00:00");
inboundFlow.expirationDateTime = OffsetDateTimeSerializer.deserialize("2023-03-13T11:10:46.924769+00:00");
inboundFlow.additionalDataManager().put("year@odata.bind", new JsonPrimitive("https://graph.microsoft.com/beta/external/industryData/years/ebf18762-ab92-487e-21d1-08daddab28bb"));
graphClient.external().industryData().inboundFlows()
.buildRequest()
.post(inboundFlow);
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewInboundFlow()
dataDomain := graphmodels.EDUCATIONROSTERING_INBOUNDDOMAIN
requestBody.SetDataDomain(&dataDomain)
displayName := "Inbound rostering flow"
requestBody.SetDisplayName(&displayName)
effectiveDateTime , err := time.Parse(time.RFC3339, "2023-03-12T16:40:46.924769+05:30")
requestBody.SetEffectiveDateTime(&effectiveDateTime)
expirationDateTime , err := time.Parse(time.RFC3339, "2023-03-13T16:40:46.924769+05:30")
requestBody.SetExpirationDateTime(&expirationDateTime)
additionalData := map[string]interface{}{
"odataBind" : "https://graph.microsoft.com/beta/external/industryData/dataConnectors/51dca0a0-85f6-4478-f526-08daddab2271",
"odataBind" : "https://graph.microsoft.com/beta/external/industryData/years/ebf18762-ab92-487e-21d1-08daddab28bb",
}
requestBody.SetAdditionalData(additionalData)
result, err := graphClient.External().IndustryData().InboundFlows().Post(context.Background(), requestBody, nil)
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new InboundFlow();
$requestBody->set@odatatype('#microsoft.graph.industryData.inboundFileFlow');
$requestBody->setDataDomain(new InboundDomain('educationrostering'));
$requestBody->setDisplayName('Inbound rostering flow');
$requestBody->setEffectiveDateTime(new DateTime('2023-03-12T16:40:46.924769+05:30'));
$requestBody->setExpirationDateTime(new DateTime('2023-03-13T16:40:46.924769+05:30'));
$additionalData = [
'dataConnector@odata.bind' => 'https://graph.microsoft.com/beta/external/industryData/dataConnectors/51dca0a0-85f6-4478-f526-08daddab2271',
'year@odata.bind' => 'https://graph.microsoft.com/beta/external/industryData/years/ebf18762-ab92-487e-21d1-08daddab28bb',
];
$requestBody->setAdditionalData($additionalData);
$requestResult = $graphServiceClient->external()->industryData()->inboundFlows()->post($requestBody);
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.industryData.inboundFileFlow",
"dataDomain": "educationRostering",
"displayName": "Inbound rostering fow",
"effectiveDateTime": "2023-03-12T11:10:46.924769Z",
"expirationDateTime": "2023-03-13T11:10:46.924769Z",
"id": "7bd62d17-8c37-4494-f68d-08daddab2911",
"readinessStatus": "ready"
}