githubEdit

8 Service APIs

This section provides a reference for APIs that should be implemented by this Building Block.

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 documentarrow-up-right 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 repositoryarrow-up-right.

8.1 API specification

The following is an automated rendition of our latest OpenAPI YAML specificationarrow-up-right.

CREATE - Creates a new Policy object and returns the new object and a PolicyRevision

post

CREATE - Creates a new Policy object and returns the new object and a PolicyRevision

Body
Responses
chevron-right
200

A set consisting of the new Policy object created, together with the initial Revision object.

application/json
post
/config/policy/

READ - get a Policy object + latest Revisio

get

READ - get a Policy object + latest Revisio

Path parameters
policyIdstringRequired

Unique ID of an object

Query parameters
revisionIdstringOptional

An object with id revisionId

Responses
chevron-right
200Success
application/json
get
/config/policy/{policyId}/

LIST - returns the current Policy

get

LIST - returns the current Policy

Path parameters
policyIdstringRequired

Unique ID of an object

Query parameters
offsetintegerOptional

Requested index for start of resources to be provided in response requested by client

limitintegerOptional

Requested number of resources to be provided in response requested by client

Responses
chevron-right
200Success
application/json
get
/config/policy/{policyId}/revisions/

Returns a list of readable Policy objects

get

LIST - Fetches list of readable Policy objects

Query parameters
revisionIdstringOptional

An object with id revisionId

offsetintegerOptional

Requested index for start of resources to be provided in response requested by client

limitintegerOptional

Requested number of resources to be provided in response requested by client

Responses
chevron-right
200

A list of Policy objects readable for the current session's credentials.

application/json
get
/config/policies/

8.2 Service APIs

CREATE - Creates an Individual in the Consent system

post

CREATE - Creates an Individual in the Consent system

Body
Responses
chevron-right
200Success
application/json
post
/service/individual/

READ - Fetch an Individual in the Consent system

get

READ - Fetch an Individual in the Consent system

Path parameters
individualIdstringRequired

Unique ID of an object

Responses
chevron-right
200Success
application/json
get
/service/individual/{individualId}/

UPDATE - Updates an Individual in the Consent system

put

UPDATE - Updates an Individual in the Consent system

Path parameters
individualIdstringRequired

Unique ID of an object

Body
Responses
chevron-right
200Success
application/json
put
/service/individual/{individualId}/

LIST - lists individuals in the system

get

LIST - lists individuals in the system

Query parameters
offsetintegerOptional

Requested index for start of resources to be provided in response requested by client

limitintegerOptional

Requested number of resources to be provided in response requested by client

Responses
chevron-right
200Success
application/json
get
/service/individuals/

READ - fetches the latest version of a Policy and the presented revisionId of an associated Agreement

get

READ - fetches the latest version of a Policy and the presented revisionId of an associated Agreement

Path parameters
policyIdstringRequired

Unique ID of an object

Query parameters
revisionIdstringOptional

An object with id revisionId

Responses
chevron-right
200Success
application/json
get
/service/policy/{policyId}/

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

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.

Responses
chevron-right
200Success

No content

delete
/service/individual/record/

No content

8.3 Audit APIs

Last updated

Was this helpful?