8 Service APIs
This section provides a reference for APIs that should be implemented by this Building Block.
Last updated
Was this helpful?
This section provides a reference for APIs that should be implemented by this Building Block.
Last updated
Was this helpful?
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.
The following is an automated rendition of our latest OpenAPI YAML specification.
None
CREATE - Creates a new Policy object and returns the new object and a PolicyRevision
/config/policy/
An object of type Policy
READ - get a Policy object + latest Revision. If a PolicyFilter is supplied and contains a revision_id, then this specific revision is returned.
/config/policy/{policyId}//
Unique ID of an object
An object with id revisionId
UPDATE - Updates an existing Policy object, returning the updated version and a new revision. Updating a Policy does not affect existing references in Agreement, the new revision should be specified for Agreement.
/config/policy/{policyId}//
Unique ID of an object
An object of type Policy
DELETE - Deletes an existing Policy object, returning the updated version and a new revision. Deleting a Policy is not possible if it's associated with active Agreement.
/config/policy/{policyId}//
Unique ID of an object
LIST - returns the current Policy
/config/policy/{policyId}/revisions/
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
LIST - Fetches list of readable Policy objects
/config/policies/
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
CREATE - Creates an Individual in the Consent system
/service/individual/
An object of type Individual
READ - Fetch an Individual in the Consent system
/service/individual/{individualId}//
Unique ID of an object
UPDATE - Updates an Individual in the Consent system
/service/individual/{individualId}//
Unique ID of an object
An object of type Individual
LIST - lists individuals in the system
/service/individuals/
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
READ - fetches the latest version of a Policy and the presented revisionId of an associated Agreement
/service/policy/{policyId}//