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 our latest OpenAPI YAML specification.
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
POST /apis/GovStack/consent-management-bb//config/policy/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 173
{
"policy": {
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
}
}[
{
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
}
]READ - get a Policy object + latest Revision. If a PolicyFilter is supplied and contains a revision_id, then this specific revision is returned.
READ - get a Policy object + latest Revision. If a PolicyFilter is supplied and contains a revision_id, then this specific revision is returned.
- : Grants access to org operations
Unique ID of an object
An object with id revisionId
bad input parameter
GET /apis/GovStack/consent-management-bb//config/policy/{policyId}/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
{
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
}
]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.
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.
- : Grants access to org operations
Unique ID of an object
bad input parameter
PUT /apis/GovStack/consent-management-bb//config/policy/{policyId}/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 173
{
"policy": {
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
}
}[
{
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
}
]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.
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.
- : Grants access to org operations
Unique ID of an object
bad input parameter
DELETE /apis/GovStack/consent-management-bb//config/policy/{policyId}/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
"id": "",
"schema_name": "",
"object_id": "",
"signed_without_object_id": "",
"serialized_snapshot": "",
"serialized_hash": "",
"timestamp": "",
"authorized_by_individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
},
"authorized_by_other": "",
"successor": {
"id": "",
"schema_name": "",
"object_id": "",
"signed_without_object_id": "",
"serialized_snapshot": "",
"serialized_hash": "",
"timestamp": "",
"authorized_by_individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
},
"authorized_by_other": "",
"successor": {
"id": "",
"schema_name": "",
"object_id": "",
"signed_without_object_id": "",
"serialized_snapshot": "",
"serialized_hash": "",
"timestamp": "",
"authorized_by_individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
},
"authorized_by_other": "",
"successor": {
"id": "",
"schema_name": "",
"object_id": "",
"signed_without_object_id": "",
"serialized_snapshot": "",
"serialized_hash": "",
"timestamp": "",
"authorized_by_individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
},
"authorized_by_other": "",
"successor": {
"id": "",
"schema_name": "",
"object_id": "",
"signed_without_object_id": "",
"serialized_snapshot": "",
"serialized_hash": "",
"timestamp": "",
"authorized_by_individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
},
"authorized_by_other": "",
"successor": {
"id": "",
"schema_name": "",
"object_id": "",
"signed_without_object_id": "",
"serialized_snapshot": "",
"serialized_hash": "",
"timestamp": "",
"authorized_by_individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
},
"authorized_by_other": "",
"successor": "[Circular Reference]",
"predecessor_hash": "",
"predecessor_signature": ""
},
"predecessor_hash": "",
"predecessor_signature": ""
},
"predecessor_hash": "",
"predecessor_signature": ""
},
"predecessor_hash": "",
"predecessor_signature": ""
},
"predecessor_hash": "",
"predecessor_signature": ""
},
"predecessor_hash": "",
"predecessor_signature": ""
}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
GET /apis/GovStack/consent-management-bb//config/policy/{policyId}/revisions/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
}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
GET /apis/GovStack/consent-management-bb//config/policies/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
{
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
}
]8.1.2 Service APIs
CREATE - Creates an Individual in the Consent system
- : Grants access to org operations
bad input parameter
POST /apis/GovStack/consent-management-bb//service/individual/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 89
{
"individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
}
}{
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
}READ - Fetch an Individual in the Consent system
- : Grants access to org operations
Unique ID of an object
bad input parameter
GET /apis/GovStack/consent-management-bb//service/individual/{individualId}/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
}UPDATE - Updates an Individual in the Consent system
- : Grants access to org operations
Unique ID of an object
bad input parameter
PUT /apis/GovStack/consent-management-bb//service/individual/{individualId}/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 89
{
"individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
}
}{
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
}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
GET /apis/GovStack/consent-management-bb//service/individuals/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
{
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
}
]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
GET /apis/GovStack/consent-management-bb//service/policy/{policyId}/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
{
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
}
]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
DELETE /apis/GovStack/consent-management-bb//service/individual/record/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
No content
8.1.3 Audit APIs
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
GET /apis/GovStack/consent-management-bb//audit/consentrecord/{consentRecordId}/ HTTP/1.1
Host: app.swaggerhub.com
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
"id": "",
"agreement": {
"id": "",
"version": "",
"controller": {
"id": "",
"name": "",
"url": ""
},
"policy": {
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
},
"purpose": {
"id": "",
"name": "",
"description": "",
"serialized_hash": ""
},
"lawful_basis": "",
"data_use": "",
"dpia": "",
"signature": {
"id": "",
"payload": "",
"signature": "",
"verification_method": "",
"verification_payload": "",
"verification_payload_hash": "",
"verification_artifact": "",
"verification_signed_by": "",
"verification_signed_as": "",
"verification_jws_header": "",
"timestamp": "",
"signed_without_object_reference": "",
"object_type": "",
"object_reference": ""
},
"active": "",
"forgettable": "",
"compatible_with_version": {
"id": "",
"version": "",
"controller": {
"id": "",
"name": "",
"url": ""
},
"policy": {
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
},
"purpose": {
"id": "",
"name": "",
"description": "",
"serialized_hash": ""
},
"lawful_basis": "",
"data_use": "",
"dpia": "",
"signature": {
"id": "",
"payload": "",
"signature": "",
"verification_method": "",
"verification_payload": "",
"verification_payload_hash": "",
"verification_artifact": "",
"verification_signed_by": "",
"verification_signed_as": "",
"verification_jws_header": "",
"timestamp": "",
"signed_without_object_reference": "",
"object_type": "",
"object_reference": ""
},
"active": "",
"forgettable": "",
"compatible_with_version": {
"id": "",
"version": "",
"controller": {
"id": "",
"name": "",
"url": ""
},
"policy": {
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
},
"purpose": {
"id": "",
"name": "",
"description": "",
"serialized_hash": ""
},
"lawful_basis": "",
"data_use": "",
"dpia": "",
"signature": {
"id": "",
"payload": "",
"signature": "",
"verification_method": "",
"verification_payload": "",
"verification_payload_hash": "",
"verification_artifact": "",
"verification_signed_by": "",
"verification_signed_as": "",
"verification_jws_header": "",
"timestamp": "",
"signed_without_object_reference": "",
"object_type": "",
"object_reference": ""
},
"active": "",
"forgettable": "",
"compatible_with_version": {
"id": "",
"version": "",
"controller": {
"id": "",
"name": "",
"url": ""
},
"policy": {
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
},
"purpose": {
"id": "",
"name": "",
"description": "",
"serialized_hash": ""
},
"lawful_basis": "",
"data_use": "",
"dpia": "",
"signature": {
"id": "",
"payload": "",
"signature": "",
"verification_method": "",
"verification_payload": "",
"verification_payload_hash": "",
"verification_artifact": "",
"verification_signed_by": "",
"verification_signed_as": "",
"verification_jws_header": "",
"timestamp": "",
"signed_without_object_reference": "",
"object_type": "",
"object_reference": ""
},
"active": "",
"forgettable": "",
"compatible_with_version": {
"id": "",
"version": "",
"controller": {
"id": "",
"name": "",
"url": ""
},
"policy": {
"id": "",
"name": "",
"version": "",
"url": "",
"jurisdiction": "",
"industry_sector": "",
"data_retention_period_days": "",
"geographic_restriction": "",
"storage_location": ""
},
"purpose": {
"id": "",
"name": "",
"description": "",
"serialized_hash": ""
},
"lawful_basis": "",
"data_use": "",
"dpia": "",
"signature": {
"id": "",
"payload": "",
"signature": "",
"verification_method": "",
"verification_payload": "",
"verification_payload_hash": "",
"verification_artifact": "",
"verification_signed_by": "",
"verification_signed_as": "",
"verification_jws_header": "",
"timestamp": "",
"signed_without_object_reference": "",
"object_type": "",
"object_reference": ""
},
"active": "",
"forgettable": "",
"compatible_with_version": "[Circular Reference]",
"lifecycle": {
"id": "",
"name": ""
}
},
"lifecycle": {
"id": "",
"name": ""
}
},
"lifecycle": {
"id": "",
"name": ""
}
},
"lifecycle": {
"id": "",
"name": ""
}
},
"lifecycle": {
"id": "",
"name": ""
}
},
"agreement_revision": {
"id": "",
"schema_name": "",
"object_id": "",
"signed_without_object_id": "",
"serialized_snapshot": "",
"serialized_hash": "",
"timestamp": "",
"authorized_by_individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
},
"authorized_by_other": "",
"successor": {
"id": "",
"schema_name": "",
"object_id": "",
"signed_without_object_id": "",
"serialized_snapshot": "",
"serialized_hash": "",
"timestamp": "",
"authorized_by_individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
},
"authorized_by_other": "",
"successor": {
"id": "",
"schema_name": "",
"object_id": "",
"signed_without_object_id": "",
"serialized_snapshot": "",
"serialized_hash": "",
"timestamp": "",
"authorized_by_individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
},
"authorized_by_other": "",
"successor": {
"id": "",
"schema_name": "",
"object_id": "",
"signed_without_object_id": "",
"serialized_snapshot": "",
"serialized_hash": "",
"timestamp": "",
"authorized_by_individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
},
"authorized_by_other": "",
"successor": {
"id": "",
"schema_name": "",
"object_id": "",
"signed_without_object_id": "",
"serialized_snapshot": "",
"serialized_hash": "",
"timestamp": "",
"authorized_by_individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
},
"authorized_by_other": "",
"successor": "[Circular Reference]",
"predecessor_hash": "",
"predecessor_signature": ""
},
"predecessor_hash": "",
"predecessor_signature": ""
},
"predecessor_hash": "",
"predecessor_signature": ""
},
"predecessor_hash": "",
"predecessor_signature": ""
},
"predecessor_hash": "",
"predecessor_signature": ""
},
"agreement_revision_hash": "",
"individual": {
"id": "",
"external_id": "",
"external_id_type": "",
"identity_provider_id": ""
},
"opt_in": "",
"state": "",
"signature": {
"id": "",
"payload": "",
"signature": "",
"verification_method": "",
"verification_payload": "",
"verification_payload_hash": "",
"verification_artifact": "",
"verification_signed_by": "",
"verification_signed_as": "",
"verification_jws_header": "",
"timestamp": "",
"signed_without_object_reference": "",
"object_type": "",
"object_reference": ""
}
}None
Last updated
Was this helpful?