Example Changing the compliance settings for an HCP namespace

Content Platform Tenant Management Help

Version
9.7.x
File Size
4269 KB
Audience
anonymous
Part Number
MK-95HCPH002-19

Here’s a sample POST request that changes the compliance settings for the Accounts-Receivable namespace. The new settings are in an XML file named AR-compliance.xml. The request is made using a tenant-level user account that includes the compliance role.

Request body in XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<complianceSettings>
    <retentionDefault>A+7y</retentionDefault>
    <minimumRetentionAfterInitialUnspecified>19y+0M+7d</minimumRetentionAfterInitialUnspecified>
    <shreddingDefault>false</shreddingDefault>
    <customMetadataChanges>all</customMetadataChanges>
    <dispositionEnabled>true</dispositionEnabled>
</complianceSettings>

Request with cURL command line

curl -k -i -d @AR-compliance.xml -H "Content-Type: application/xml"
    -H "Authorization: HCP bXdoaXRl:ad49ce36d0cec9634ef63b24151be0fb"
    "https://finance.hcp.example.com:9090/mapi/tenants/finance/namespaces/
         accounts-receivable/complianceSettings"

Request in Python using PycURL

import pycurl
import os
filehandle = open("AR-compliance.xml", 'rb')
curl = pycurl.Curl()
curl.setopt(pycurl.HTTPHEADER, ["Content-Type: application/xml",
  "Authorization: HCP \
  bXdoaXRl:ad49ce36d0cec9634ef63b24151be0fb"])
curl.setopt(pycurl.URL,
  "https://finance.hcp.example.com:9090/mapi/tenants/finance/" +
 "namespaces/accounts-receivable/complianceSettings")
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
curl.setopt(pycurl.UPLOAD, 1)
curl.setopt(pycurl.CUSTOMREQUEST, "POST")
curl.setopt(pycurl.INFILESIZE,
  os.path.getsize("AR-compliance.xml"))
curl.setopt(pycurl.READFUNCTION, filehandle.read)
curl.perform()
print curl.getinfo(pycurl.RESPONSE_CODE)
curl.close()
filehandle.close()

Request headers

POST /mapi/tenants/finance/namespaces/accounts-receivable/complianceSettings
  HTTP/1.1
Host: finance.hcp.example.com:9090
Authorization: HCP bXdoaXRl:ad49ce36d0cec9634ef63b24151be0fb
Content-Type: application/xml
Content-Length: 285

Response headers

HTTP/1.1 200 OK
Content-Type: application/xml
X-HCP-SoftwareVersion: 9.0.0.2
Content-Length: 0