Create Revision
POST {{apiPath}}/environments/{{envID}}/agreements/{{agreementID}}/languages/{{languageID}}/revisions
The POST /environments/{{envID}}/agreements/{{agreementID}}/languages/{{languageID}}/revisions
endpoint creates a new revision resource in the specified environment.
The request body must include values for the effectiveAt
, requireReconsent
, and text
properties.
Note: When setting the agreement revision's effectiveAt
property to a variable such as {{now}}
, you need to calculate the now value and set it as an ISO timestamp (for example, 2022-04-27T21:40:58.467Z
). Also, verify that your computer's Set date and time automatically system property is enabled. If it is disabled, it could result in a discrepancy that causes an error when setting the effective date. The browser's javascript depends on the machine's running time to save the agreement revision date.
The response does not include the text
property. To access this value, use the _links.text
URL.
Prerequisites
See Agreement Management for important overview information.
Before you can create an agreement consent revision in a specific language for the consent, you must set a default language for the environment using the Language Management APIs. See Create Language and Read Languages.
Create an agreement to get an
agreementID
. See Create Agreement.Create a language to get a
languageID
. See Create Language.
For property descriptions, see Revision data model.
Property | Type | Required? |
---|---|---|
effectiveAt | Date | Required |
requiresReconsent | Boolean | Required |
text | String | Required |
contentType | String | Required |
Request Body
{"effectiveAt"=>"2098-08-01T22:45:44.497Z", "requireReconsent"=>false, "text"=>"Test, test, test", "contentType"=>"text/plain"}
RESPONSES
status: Created
{"_links":{"self":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/agreements/d462d436-cf80-421c-8c05-881e9958c4b4/languages/7e156496-4e67-4adc-a139-ebbbbe2c1aea/revisions/aab73db4-9432-4149-9d24-daa8e6e1289b"},"environment":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"},"agreement":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/agreements/d462d436-cf80-421c-8c05-881e9958c4b4"},"language":{"href":"https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/agreements/d462d436-cf80-421c-8c05-881e9958c4b4/languages/7e156496-4e67-4adc-a139-ebbbbe2c1aea"},"text":{"href":"https://agreement-mgmt.pingone.com/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/agreements/d462d436-cf80-421c-8c05-881e9958c4b4/languages/7e156496-4e67-4adc-a139-ebbbbe2c1aea/revisions/aab73db4-9432-4149-9d24-daa8e6e1289b.json"}},"id":"aab73db4-9432-4149-9d24-daa8e6e1289b","environment":{"id":"abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"},"agreement":{"id":"d462d436-cf80-421c-8c05-881e9958c4b4"},"language":{"id":"7e156496-4e67-4adc-a139-ebbbbe2c1aea"},"effectiveAt":"2098-08-01T22:45:44.497Z","contentType":"text/plain","requireReconsent":false}