创建 inboundFlow
本文内容
命名空间:microsoft.graph.industryData
重要
Microsoft Graph /beta
版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
创建新的 inboundFlow 对象。
创建 inboundFlow 时,需要以下先决条件资源:
此 API 可用于以下国家级云部署 。
全局服务
美国政府 L4
美国政府 L5 (DOD)
由世纪互联运营的中国
✅
❌
❌
❌
权限
为此 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"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.IndustryData;
var requestBody = new InboundFileFlow
{
OdataType = "#microsoft.graph.industryData.inboundFileFlow",
DataDomain = 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"
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.External.IndustryData.InboundFlows.PostAsync(requestBody);
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta external industry-data inbound-flows create --body '{\
"@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"\
}\
'
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelsindustrydata "github.com/microsoftgraph/msgraph-beta-sdk-go/models/industrydata"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodelsindustrydata.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)
inboundFlows, err := graphClient.External().IndustryData().InboundFlows().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.industrydata.InboundFileFlow inboundFlow = new com.microsoft.graph.beta.models.industrydata.InboundFileFlow();
inboundFlow.setOdataType("#microsoft.graph.industryData.inboundFileFlow");
inboundFlow.setDataDomain(com.microsoft.graph.beta.models.industrydata.InboundDomain.EducationRostering);
inboundFlow.setDisplayName("Inbound rostering flow");
OffsetDateTime effectiveDateTime = OffsetDateTime.parse("2023-03-12T16:40:46.924769+05:30");
inboundFlow.setEffectiveDateTime(effectiveDateTime);
OffsetDateTime expirationDateTime = OffsetDateTime.parse("2023-03-13T16:40:46.924769+05:30");
inboundFlow.setExpirationDateTime(expirationDateTime);
HashMap<String, Object> additionalData = new HashMap<String, Object>();
additionalData.put("dataConnector@odata.bind", "https://graph.microsoft.com/beta/external/industryData/dataConnectors/51dca0a0-85f6-4478-f526-08daddab2271");
additionalData.put("year@odata.bind", "https://graph.microsoft.com/beta/external/industryData/years/ebf18762-ab92-487e-21d1-08daddab28bb");
inboundFlow.setAdditionalData(additionalData);
com.microsoft.graph.models.industrydata.InboundFlow result = graphClient.external().industryData().inboundFlows().post(inboundFlow);
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);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\InboundFileFlow;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new InboundFileFlow();
$requestBody->setOdataType('#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);
$result = $graphServiceClient->external()->industryData()->inboundFlows()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Search
$params = @{
"@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 = [System.DateTime]::Parse("2023-03-12T16:40:46.924769+05:30")
expirationDateTime = [System.DateTime]::Parse("2023-03-13T16:40:46.924769+05:30")
"year@odata.bind" = "https://graph.microsoft.com/beta/external/industryData/years/ebf18762-ab92-487e-21d1-08daddab28bb"
}
New-MgBetaExternalIndustryDataInboundFlow -BodyParameter $params
from msgraph import GraphServiceClient
from msgraph.generated.models.inbound_file_flow import InboundFileFlow
graph_client = GraphServiceClient(credentials, scopes)
request_body = InboundFileFlow(
odata_type = "#microsoft.graph.industryData.inboundFileFlow",
data_domain = InboundDomain.EducationRostering,
display_name = "Inbound rostering flow",
effective_date_time = "2023-03-12T16:40:46.924769+05:30",
expiration_date_time = "2023-03-13T16:40:46.924769+05:30",
additional_data = {
"data_connector@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",
}
)
result = await graph_client.external.industry_data.inbound_flows.post(request_body)
响应
以下示例显示了相应的响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
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"
}