educationSynchronizationProfile: uploadUrl
本文内容
命名空间:microsoft.graph
重要
Microsoft Graph版本下的 /beta API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
检索共享访问签名 (SAS) ,以将源文件上载到租户中特定学校数据 同步配置文件 的 Azure blob 存储。 SAS 令牌的有效期为 1 小时。
上载 URL 仅为 CSV 数据提供程序提供 。
注意: 若要使用 SAS 令牌访问 blob 存储,请使用 Azure 存储 SDK 或 AzCopy 。
权限
要调用此 API,需要以下权限之一。要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限
委派(工作或学校帐户)
EduAdministration.ReadWrite
委派 (个人 Microsoft 帐户
不支持。
应用程序
EduAdministration.ReadWrite.All
HTTP 请求
GET /education/synchronizationProfiles/{id}/uploadUrl
名称
类型
说明
Authorization
string
Bearer {token}。必需。
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在响应 200 OK 正文中返回 educationSynchronizationProfile 的响应代码和 SAS URL。
如果上一个请求仍在 409 Conflict 处理中,此方法将返回 指示当前已阻止 educationSynchronizationProfile 的上载 。
示例
请求
下面展示了示例请求。
GET https://graph.microsoft.com/beta/education/synchronizationProfiles/{id}/uploadUrl
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var @string = await graphClient.Education.SynchronizationProfiles["{educationSynchronizationProfile-id}"]
.UploadUrl()
.Request()
.GetAsync();
const options = {
authProvider,
};
const client = Client.init(options);
let string = await client.api('/education/synchronizationProfiles/{id}/uploadUrl')
.version('beta')
.get();
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/beta/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/education/synchronizationProfiles/{id}/uploadUrl"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
MSGraphString *string = [[MSGraphString alloc] initWithData:data error:&nserror];
}];
[meDataTask execute];
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
String string = graphClient.education().synchronizationProfiles("{id}")
.uploadUrl()
.buildRequest()
.get();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
educationSynchronizationProfileId := "educationSynchronizationProfile-id"
result, err := graphClient.Education().SynchronizationProfilesById(&educationSynchronizationProfileId).UploadUrl()(educationSynchronizationProfile-id).Get()
Import-Module Microsoft.Graph.Education
Invoke-MgUploadEducationSynchronizationProfileUrl -EducationSynchronizationProfileId $educationSynchronizationProfileId
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 201 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#String",
"value": "https://sdsstorage.blob.core.windows.net/86904b1e-c7d0-4ead-b13a-98f11fc400ee?sv=2015-07-08&sr=c&si=SharedAccessPolicy_20170704044441&sig=CH65vxxqXETCkQNH0Lfsu31cUo0s0XcEEo0OE2YiL6Q%3D&se=2017-07-04T08%3A43%3A01Z&sp=w"
}