Data that represents the terms of use PDF document.
fileName
String
Name of the agreement file (for example, TOU.pdf).
isDefault
Boolean
If none of the languages matches the client preference, indicates whether this is the default agreement file . If none of the files are marked as default, the first one is treated as the default. Read-only.
isMajorVersion
Boolean
Indicates whether the agreement file is a major version update. Major version updates invalidate the agreement's acceptances on the corresponding language.
language
String
The language of the agreement file in the format "languagecode2-country/regioncode2". "languagecode2" is a lowercase two-letter code derived from ISO 639-1, while "country/regioncode2" is derived from ISO 3166 and usually consists of two uppercase letters, or a BCP-47 language tag. For example, U.S. English is en-US.
Response
If successful, this method returns a 200 OK response code and an agreementFileLocalization object in the response body.
POST https://graph.microsoft.com/v1.0/identityGovernance/termsOfUse/agreements/94410bbf-3d3e-4683-8149-f034e55c39dd/files
Content-Type: application/json
{
"fileName": "Contoso ToU for guest users (French)",
"language": "fr-FR",
"isDefault": false,
"isMajorVersion": false,
"displayName": "Contoso ToU for guest users (French)",
"fileData": {
"data": "base64JVBERi0xLjUKJb/3ov4KNCAwIG9iago8PCAvTGluZWFyaX//truncated-binary-data"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new AgreementFileLocalization
{
FileName = "Contoso ToU for guest users (French)",
Language = "fr-FR",
IsDefault = false,
IsMajorVersion = false,
DisplayName = "Contoso ToU for guest users (French)",
FileData = new AgreementFileData
{
Data = Convert.FromBase64String("base64JVBERi0xLjUKJb/3ov4KNCAwIG9iago8PCAvTGluZWFyaX//truncated-binary-data"),
},
};
var result = await graphClient.IdentityGovernance.TermsOfUse.Agreements["{agreement-id}"].Files.PostAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AgreementFileLocalization();
$requestBody->setFileName('Contoso ToU for guest users (French)');
$requestBody->setLanguage('fr-FR');
$requestBody->setIsDefault(false);
$requestBody->setIsMajorVersion(false);
$requestBody->setDisplayName('Contoso ToU for guest users (French)');
$fileData = new AgreementFileData();
$fileData->setData(\GuzzleHttp\Psr7\Utils::streamFor(base64_decode('base64JVBERi0xLjUKJb/3ov4KNCAwIG9iago8PCAvTGluZWFyaX//truncated-binary-data')));
$requestBody->setFileData($fileData);
$result = $graphServiceClient->identityGovernance()->termsOfUse()->agreements()->byAgreementId('agreement-id')->files()->post($requestBody)->wait();
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = AgreementFileLocalization(
file_name = "Contoso ToU for guest users (French)",
language = "fr-FR",
is_default = False,
is_major_version = False,
display_name = "Contoso ToU for guest users (French)",
file_data = AgreementFileData(
data = base64.urlsafe_b64decode("base64JVBERi0xLjUKJb/3ov4KNCAwIG9iago8PCAvTGluZWFyaX//truncated-binary-data"),
),
)
result = await graph_client.identity_governance.term_of_use.agreements.by_agreement_id('agreement-id').files.post(body = request_body)