8 Service APIs
This section provides a reference for APIs that should be implemented by this Building Block.
8 Service APIs
This section provides a reference for APIs that should be implemented by this Building Block. The APIs defined here establish a blueprint for how the Building Block will interact with other Building Blocks. Additional APIs may be implemented by the Building Block, but the listed APIs define a minimal set of functionality that should be provided by any implementation of this Building Block.
The GovStack non-functional requirements document provides additional information on how 'adaptors' may be used to translate an existing API to the patterns described here. This section also provides guidance on how candidate products are tested and how GovStack validates a product's API against the API specifications defined here.
The tests for the Consent Building Block can be found in this GitHub repository.
8.1 API specification
The following is an automated rendition of the OpenAPI YAML specification contained in this release.
You can see the latest unreleased version of the OpenAPI specification in the main branch of our GitHub repository.
8.1.1 Config APIs
CREATE - Creates a new Policy object and returns the new object and a PolicyRevision
- : Grants access to org operations
A set consisting of the new Policy object created, together with the initial Revision object.
bad input parameter
READ - get a Policy object + latest Revisio
- : Grants access to org operations
Unique ID of an object
An object with id revisionId
bad input parameter
UPDATE - Updates an existing Policy object, returning the updated version and a new revision. Updating a Policy must not affect existing active references in DataAgreement, the new Revision should be specified for Agreement.
UPDATE - Updates an existing Policy object, returning the updated version and a new revision. Updating a Policy must not affect existing active references in DataAgreement, the new Revision should be specified for Agreement.
- : Grants access to org operations
Unique ID of an object
bad input parameter
DELETE - Deletes an existing Policy object, returning a new revision. Deleting a Policy is not possible if it's associated with active DataAgreement.
DELETE - Deletes an existing Policy object, returning a new revision. Deleting a Policy is not possible if it's associated with active DataAgreement.
- : Grants access to org operations
Unique ID of an object
bad input parameter
LIST - returns the current Policy
- : Grants access to org operations
Unique ID of an object
Requested index for start of resources to be provided in response requested by client
Requested number of resources to be provided in response requested by client
bad input parameter
LIST - Fetches list of readable Policy objects
- : Grants global read access
- : Grants global write access
- : Grants access to org operations
- : Grants access to data consumer operations
- : Grants access to specific individual read/write operations
- : Grants access to specific auditor read operations
An object with id revisionId
Requested index for start of resources to be provided in response requested by client
Requested number of resources to be provided in response requested by client
A list of Policy objects readable for the current session's credentials.
bad input parameter
READ - fetches the latest version of an Agreement
- : Grants access to org operations
Unique ID of an object
bad input parameter
UPDATE - An existing DataAgreement object is created and returned together with a new Revision
- : Grants access to org operations
Unique ID of an object
bad input parameter
- : Grants access to org operations
Unique ID of an object
bad input parameter
CREATE - A new DataAgreement object is created and returned together with a Revision
- : Grants access to org operations
bad input parameter
LIST - fetch all DataAgreements
- : Grants access to org operations
Requested index for start of resources to be provided in response requested by client
Requested number of resources to be provided in response requested by client
bad input parameter
CREATE - Creates an Individual in the Consent system
- : Grants access to org operations
bad input parameter
READ - Fetch an Individual in the Consent system
- : Grants access to org operations
Unique ID of an object
bad input parameter
LIST - lists individuals in the system
- : Grants access to org operations
Requested index for start of resources to be provided in response requested by client
Requested number of resources to be provided in response requested by client
bad input parameter
CREATE - Creates a new Webhook object and returns the new object
- : Grants global read access
- : Grants global write access
- : Grants access to org operations
- : Grants access to data consumer operations
- : Grants access to specific individual read/write operations
- : Grants access to specific auditor read operations
A set consisting of the new Webhook object created, together with the initial Revision object.
bad input parameter
READ - get a Webhook object.
- : Grants global read access
- : Grants global write access
- : Grants access to org operations
- : Grants access to data consumer operations
- : Grants access to specific individual read/write operations
- : Grants access to specific auditor read operations
Unique ID of an object
An object with id revisionId
bad input parameter
UPDATE - Updates an existing Webhook object, returning the updated version.
- : Grants global read access
- : Grants global write access
- : Grants access to org operations
- : Grants access to data consumer operations
- : Grants access to specific individual read/write operations
- : Grants access to specific auditor read operations
Unique ID of an object
bad input parameter
DELETE - Deletes an existing Webhook object.
- : Grants global read access
- : Grants global write access
- : Grants access to org operations
- : Grants access to data consumer operations
- : Grants access to specific individual read/write operations
- : Grants access to specific auditor read operations
Unique ID of an object
No content
bad input parameter
No content
LIST - Fetches list of readable Webhook objects
- : Grants global read access
- : Grants global write access
- : Grants access to org operations
- : Grants access to data consumer operations
- : Grants access to specific individual read/write operations
- : Grants access to specific auditor read operations
An object with id revisionId
Requested index for start of resources to be provided in response requested by client
Requested number of resources to be provided in response requested by client
A list of Webhook objects readable for the current session's credentials.
bad input parameter
8.1.2 Service APIs
CREATE - Creates an Individual in the Consent system
- : Grants access to org operations
bad input parameter
READ - Fetch an Individual in the Consent system
- : Grants access to org operations
Unique ID of an object
bad input parameter
UPDATE - Updates an Individual in the Consent system
- : Grants access to org operations
Unique ID of an object
bad input parameter
LIST - lists individuals in the system
- : Grants access to org operations
Requested index for start of resources to be provided in response requested by client
Requested number of resources to be provided in response requested by client
bad input parameter
READ - fetches the latest version of an Agreement
- : Grants access to org operations
Unique ID of an object
bad input parameter
READ - fetches the latest version of a Policy and the presented revisionId of an associated Agreement
READ - fetches the latest version of a Policy and the presented revisionId of an associated Agreement
- : Grants access to org operations
Unique ID of an object
An object with id revisionId
bad input parameter
LIST - Fetch
- : Grants access to data consumer operations
Requested index for start of resources to be provided in response requested by client
Requested number of resources to be provided in response requested by client
bad input parameter
LIST - Fetch consent records (latest revision). For a given ConsentRecordFilter, query if consent exists.
LIST - Fetch consent records (latest revision). For a given ConsentRecordFilter, query if consent exists.
- : Grants access to data consumer operations
Requested index for start of resources to be provided in response requested by client
Requested number of resources to be provided in response requested by client
bad input parameter
READ - Reads a consent record by its ID.
- : Grants access to data consumer operations
Unique ID of an object
bad input parameter
CREATE - For a particular Individual and a particular Agreement, create a new Consent Record pointing to the current Revision of a given Agreement. Individual ID supplied as HTTP header.
CREATE - For a particular Individual and a particular Agreement, create a new Consent Record pointing to the current Revision of a given Agreement. Individual ID supplied as HTTP header.
- : Grants access to specific individual read/write operations
Unique ID of an object
An object with id individualId
An object with id revisionId
bad input parameter
READ - Individual ID supplied as HTTP header. Fetches the current ConsentRecord for an Agreement. There should be one unambiguous ConsentRecord for an Individual and an Agreement.
READ - Individual ID supplied as HTTP header. Fetches the current ConsentRecord for an Agreement. There should be one unambiguous ConsentRecord for an Individual and an Agreement.
- : Grants access to specific individual read/write operations
Unique ID of an object
bad input parameter
CREATE - Gets a DRAFT (unsaved) ConsentRecord and Signature objects (without a PK) for a given dataAgreementId.
CREATE - Gets a DRAFT (unsaved) ConsentRecord and Signature objects (without a PK) for a given dataAgreementId.
- : Grants access to specific individual read/write operations
An object with id individualId
An object with id dataAgreementId
An object with id revisionId
bad input parameter
CREATE - Creates a paired ConsentRecord and Signature object. Returns the same objects with the PK defined.
CREATE - Creates a paired ConsentRecord and Signature object. Returns the same objects with the PK defined.
- : Grants access to specific individual read/write operations
bad input parameter
LIST - Fetches all current unambiguous consent records stored for Individual ID. Individual ID supplied as HTTP header.
LIST - Fetches all current unambiguous consent records stored for Individual ID. Individual ID supplied as HTTP header.
- : Grants access to specific individual read/write operations
Requested index for start of resources to be provided in response requested by client
Requested number of resources to be provided in response requested by client
bad input parameter
UPDATE* - Update a particular Consent Record, generating a new Revision object. Individual ID supplied as HTTP header. Note that updating a signed Consent Record invalidates its signature. Field set subject to update is restricted.
UPDATE* - Update a particular Consent Record, generating a new Revision object. Individual ID supplied as HTTP header. Note that updating a signed Consent Record invalidates its signature. Field set subject to update is restricted.
- : Grants access to specific individual read/write operations
Unique ID of an object
bad input parameter
CREATE - Creates and returns a Signature object for the Consent Record with a payload ready for signing. Signature object fieldset is restricted.
CREATE - Creates and returns a Signature object for the Consent Record with a payload ready for signing. Signature object fieldset is restricted.
- : Grants access to specific individual read/write operations
Unique ID of an object
bad input parameter
UPDATE - Updates a Signature object for a Consent Record. This is used to add a signature to an existing unsigned Signature object. Consent BB is responsible for updating the Consent Record state. Signature object fieldset is restricted.
UPDATE - Updates a Signature object for a Consent Record. This is used to add a signature to an existing unsigned Signature object. Consent BB is responsible for updating the Consent Record state. Signature object fieldset is restricted.
- : Grants access to specific individual read/write operations
Unique ID of an object
bad input parameter
LIST - Fetches all consent records given to a particular agreement. Individual ID supplied as HTTP header.
LIST - Fetches all consent records given to a particular agreement. Individual ID supplied as HTTP header.
- : Grants access to specific individual read/write operations
Unique ID of an object
Requested index for start of resources to be provided in response requested by client
Requested number of resources to be provided in response requested by client
bad input parameter
DELETE - Cascading delete operation for Right To Be Forgotten, deletes all Consent Records that shall not be retained and have a "forgettable" Agreement. May also delete an unsigned Consent Record, for instance in cases where the user exits the signing process. Individual ID supplied as HTTP header.
DELETE - Cascading delete operation for Right To Be Forgotten, deletes all Consent Records that shall not be retained and have a "forgettable" Agreement. May also delete an unsigned Consent Record, for instance in cases where the user exits the signing process. Individual ID supplied as HTTP header.
- : Grants access to specific individual read/write operations
No content
bad input parameter
No content
8.1.3 Audit APIs
LIST - fetch ConsentRecord objects
- : Grants global read access
- : Grants global write access
- : Grants access to org operations
- : Grants access to data consumer operations
- : Grants access to specific individual read/write operations
- : Grants access to specific auditor read operations
Requested index for start of resources to be provided in response requested by client
Requested number of resources to be provided in response requested by client
bad input parameter
READ
- : Grants global read access
- : Grants global write access
- : Grants access to org operations
- : Grants access to data consumer operations
- : Grants access to specific individual read/write operations
- : Grants access to specific auditor read operations
Unique ID of an object
bad input parameter
LIST - fetch all Agreements stored in the system.
- : Grants global read access
- : Grants global write access
- : Grants access to org operations
- : Grants access to data consumer operations
- : Grants access to specific individual read/write operations
- : Grants access to specific auditor read operations
Requested index for start of resources to be provided in response requested by client
Requested number of resources to be provided in response requested by client
bad input parameter
READ - fetch a single Agreement.
- : Grants global read access
- : Grants global write access
- : Grants access to org operations
- : Grants access to data consumer operations
- : Grants access to specific individual read/write operations
- : Grants access to specific auditor read operations
Unique ID of an object
bad input parameter
Last updated
Was this helpful?